Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] __USE_GNU ?
@ 2011-03-03  9:19 Guillaume Dargaud
  2011-03-03  9:28 ` Baruch Siach
  2011-03-03  9:40 ` Mike Frysinger
  0 siblings, 2 replies; 3+ messages in thread
From: Guillaume Dargaud @ 2011-03-03  9:19 UTC (permalink / raw)
  To: buildroot

Hello all,
I'm trying to compile some code that uses splice/vmplice and I get:
TestSockets.c:85: error: 'SPLICE_F_GIFT' undeclared (first use in this function)
TestSockets.c:86: error: 'SPLICE_F_MOVE' undeclared (first use in this function)

I use #include <fcntl.h> in my code which includes output/host/usr/powerpc-unknown-linux-
uclibc/sysroot/usr/include/bits/fcntl.h
where I see the two corresponding defines for SPLICE_F_*, but the conditional macro __USE_GNU is not defined.

A quick googling tell me it's an internal macro to uclibc, so why is it not on ?
How do I get those two macros ?

Sure, I can define them by hand, but something's fishy.

Thanks for the clarification.
-- 
Guillaume Dargaud
http://www.gdargaud.net/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] __USE_GNU ?
  2011-03-03  9:19 [Buildroot] __USE_GNU ? Guillaume Dargaud
@ 2011-03-03  9:28 ` Baruch Siach
  2011-03-03  9:40 ` Mike Frysinger
  1 sibling, 0 replies; 3+ messages in thread
From: Baruch Siach @ 2011-03-03  9:28 UTC (permalink / raw)
  To: buildroot

Hi Guillaume,

On Thu, Mar 03, 2011 at 10:19:44AM +0100, Guillaume Dargaud wrote:
> Hello all,
> I'm trying to compile some code that uses splice/vmplice and I get:
> TestSockets.c:85: error: 'SPLICE_F_GIFT' undeclared (first use in this function)
> TestSockets.c:86: error: 'SPLICE_F_MOVE' undeclared (first use in this function)
> 
> I use #include <fcntl.h> in my code which includes output/host/usr/powerpc-unknown-linux-
> uclibc/sysroot/usr/include/bits/fcntl.h
> where I see the two corresponding defines for SPLICE_F_*, but the conditional macro __USE_GNU is not defined.
> 
> A quick googling tell me it's an internal macro to uclibc, so why is it not on ?
> How do I get those two macros ?
> 
> Sure, I can define them by hand, but something's fishy.
> 
> Thanks for the clarification.

Make sure to define _GNU_SOURCE before including any header.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] __USE_GNU ?
  2011-03-03  9:19 [Buildroot] __USE_GNU ? Guillaume Dargaud
  2011-03-03  9:28 ` Baruch Siach
@ 2011-03-03  9:40 ` Mike Frysinger
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2011-03-03  9:40 UTC (permalink / raw)
  To: buildroot

On Thursday, March 03, 2011 04:19:44 Guillaume Dargaud wrote:
> A quick googling tell me it's an internal macro to uclibc, so why is it not
> on ? How do I get those two macros ?

you need to define _GNU_SOURCE before including any C library header files.  
this is by design, and is not specific to uClibc.  please read the  
feature_test_macros(7) man page.

also, this has nothing to do with buildroot.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110303/eb48a8e6/attachment.asc>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-03  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03  9:19 [Buildroot] __USE_GNU ? Guillaume Dargaud
2011-03-03  9:28 ` Baruch Siach
2011-03-03  9:40 ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox