Mercurial > hg > toybox
diff 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 |
line wrap: on
line diff
--- a/lib/portability.h Thu Jun 14 00:33:33 2012 -0500 +++ b/lib/portability.h Sat Jun 16 14:19:56 2012 -0500 @@ -9,21 +9,18 @@ #define _FILE_OFFSET_BITS 64 -#include <features.h> +// This isn't in the spec, but it's how we determine what we're using. -//#define _POSIX_C_SOURCE 200809L -//#define _XOPEN_SOURCE 600 -//#define _BSD_SOURCE -//#define _SVID_SOURCE - -//#include <stdio.h> -//#define fdprintf(...) dprintf(__VA_ARGS__) +#include <features.h> #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); +// Another one. "Function prototypes shall be provided." but aren't. +// http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html +char *crypt(const char *key, const char *salt); #endif #ifdef __GNUC__