[LC++]Best way to get sigaction header code included?
Dr Mark H Phillips
mark at austrics.com.au
Mon Feb 24 07:16:02 UTC 2003
Hi Torsten,
Thanks again for your help!
On Tue, 2003-02-18 at 20:22, Torsten Rennett wrote:
>
> read about "Feature Test Macros", e.g. in the libc-Info
> (Node: Introduction -> Using the Library -> Feature Test Macros).
> IIRC you have to set '-D_POSIX_SOURCE=1' or '-D_POSIX_C_SOURCE=199506L'.
>
> '__USE_POSIX' and '__EXTENSIONS__' are internally used macros, note the
> double underscore! (You've got it from a lookup in the header files,
> right?) Do not use that, it's far from portable.
Thanks for this advice. The info reference was very useful. In the end
I found that putting:
#ifdef LINUX
#undef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#ifdef SUNOS
#undef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#endif
seemed to be the best solution. These automatically set
POSIX_C_SOURCE=199506L as well as a few other settings.
Cheers,
Mark.
--
Dr Mark H Phillips
Research Analyst (Mathematician)
AUSTRICS - smarter scheduling solutions - www.austrics.com
Level 2, 50 Pirie Street, Adelaide SA 5000, Australia
Phone +61 8 8226 9850
Fax +61 8 8231 4821
Email mark at austrics.com.au
More information about the tuxCPProgramming
mailing list