Mercurial > hg > toybox
comparison lib/portability.h @ 600:58d2fd7484bd
More header fiddling: crypt.h is silly, SUSv4 requires crypt() to be prototyped in unistd.h. The fact glibc refuses to do so without a wacky #define is a glibc bug, treat it as such.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 16 Jun 2012 14:19:56 -0500 |
parents | b2194045c40e |
children | 8871e8002812 |
comparison
equal
deleted
inserted
replaced
599:4d0498e1f657 | 600:58d2fd7484bd |
---|---|
7 | 7 |
8 #undef _FORTIFY_SOURCE | 8 #undef _FORTIFY_SOURCE |
9 | 9 |
10 #define _FILE_OFFSET_BITS 64 | 10 #define _FILE_OFFSET_BITS 64 |
11 | 11 |
12 // This isn't in the spec, but it's how we determine what we're using. | |
13 | |
12 #include <features.h> | 14 #include <features.h> |
13 | |
14 //#define _POSIX_C_SOURCE 200809L | |
15 //#define _XOPEN_SOURCE 600 | |
16 //#define _BSD_SOURCE | |
17 //#define _SVID_SOURCE | |
18 | |
19 //#include <stdio.h> | |
20 //#define fdprintf(...) dprintf(__VA_ARGS__) | |
21 | 15 |
22 #ifdef __GLIBC__ | 16 #ifdef __GLIBC__ |
23 // An SUSv4 function that glibc refuses to #define without crazy #defines, | 17 // An SUSv4 function that glibc refuses to #define without crazy #defines, |
24 // see http://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html | 18 // see http://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html |
25 #include <time.h> | 19 #include <time.h> |
26 char *strptime(const char *buf, const char *format, struct tm *tm); | 20 char *strptime(const char *buf, const char *format, struct tm *tm); |
21 // Another one. "Function prototypes shall be provided." but aren't. | |
22 // http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html | |
23 char *crypt(const char *key, const char *salt); | |
27 #endif | 24 #endif |
28 | 25 |
29 #ifdef __GNUC__ | 26 #ifdef __GNUC__ |
30 #define noreturn __attribute__((noreturn)) | 27 #define noreturn __attribute__((noreturn)) |
31 #else | 28 #else |