Re: question on using random in C on FC4 (perhaps slightly OT)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



STYMA, ROBERT E (ROBERT) wrote:

> For whatever reason, the declare for srandom in 
> /usr/include/stdlib.h is surrounded by the #ifdef
> 
> #if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD 

/usr/include/features.h has this

    163 /* If nothing (other than _GNU_SOURCE) is defined,
    164    define _BSD_SOURCE and _SVID_SOURCE.  */
    165 #if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
    166      !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
    167      !defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
    168      !defined _BSD_SOURCE && !defined _SVID_SOURCE)
    169 # define _BSD_SOURCE    1
    170 # define _SVID_SOURCE   1
    171 #endif

That include also undefs __USE_BSD destroying the chance to use a -D for it.

Fact is that C99 defeats the prototypes for the BSD stuff for some reason.

Cut and paste the prototypes from stdlib.h into your code :-)

-Andy

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux