diff options
author | Rob Landley <rob@landley.net> | 2012-03-19 19:19:21 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2012-03-19 19:19:21 -0500 |
commit | ee00a7f4587c1b75dedb71b5aa3d12608fb7b54c (patch) | |
tree | 1898173cb11a34f3565ea134286e1060f8b0e743 /lib/portability.h | |
parent | 522d90613ae7dc728a98d3ce3b939b4ad9b30f25 (diff) | |
download | toybox-ee00a7f4587c1b75dedb71b5aa3d12608fb7b54c.tar.gz |
Remove "feature test macros", replace non-portable fdprintf() with standard fprintf().
Diffstat (limited to 'lib/portability.h')
-rw-r--r-- | lib/portability.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/portability.h b/lib/portability.h index 832dd123..9b8d294f 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -9,13 +9,22 @@ #define _FILE_OFFSET_BITS 64 -#define _POSIX_C_SOURCE 200809L -#define _XOPEN_SOURCE 600 -#define _BSD_SOURCE -#define _SVID_SOURCE +#include <features.h> -#include <stdio.h> -#define fdprintf(...) dprintf(__VA_ARGS__) +//#define _POSIX_C_SOURCE 200809L +//#define _XOPEN_SOURCE 600 +//#define _BSD_SOURCE +//#define _SVID_SOURCE + +//#include <stdio.h> +//#define fdprintf(...) dprintf(__VA_ARGS__) + +#ifdef __GLIBC__ +// An SUSv4 function that glibc refuses to #define without crazy #defines, +// see http://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html +#include <time.h> +char *strptime(const char *buf, const char *format, struct tm *tm); +#endif #ifdef __GNUC__ #define noreturn __attribute__((noreturn)) |