Mercurial > hg > toybox
diff lib/portability.h @ 550:b2194045c40e
Remove "feature test macros", replace non-portable fdprintf() with standard fprintf().
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 19 Mar 2012 19:19:21 -0500 |
parents | 1f5bd8c93093 |
children | 58d2fd7484bd |
line wrap: on
line diff
--- a/lib/portability.h Fri Mar 16 06:42:08 2012 -0500 +++ b/lib/portability.h Mon Mar 19 19:19:21 2012 -0500 @@ -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> + +//#define _POSIX_C_SOURCE 200809L +//#define _XOPEN_SOURCE 600 +//#define _BSD_SOURCE +//#define _SVID_SOURCE -#include <stdio.h> -#define fdprintf(...) dprintf(__VA_ARGS__) +//#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))