From 628eb9b22032fb0f2e343f43efa60ec52b01d345 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 16 Jun 2012 14:19:56 -0500 Subject: 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. --- lib/portability.h | 13 +++++-------- toys.h | 7 ++----- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/portability.h b/lib/portability.h index 9b8d294f..92d8f96f 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -9,21 +9,18 @@ #define _FILE_OFFSET_BITS 64 -#include - -//#define _POSIX_C_SOURCE 200809L -//#define _XOPEN_SOURCE 600 -//#define _BSD_SOURCE -//#define _SVID_SOURCE +// This isn't in the spec, but it's how we determine what we're using. -//#include -//#define fdprintf(...) dprintf(__VA_ARGS__) +#include #ifdef __GLIBC__ // An SUSv4 function that glibc refuses to #define without crazy #defines, // see http://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html #include 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__ diff --git a/toys.h b/toys.h index 34cf035f..a3339868 100644 --- a/toys.h +++ b/toys.h @@ -8,7 +8,6 @@ #include "lib/portability.h" -#include #include #include #include @@ -37,18 +36,16 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include -#undef _XOPEN_SOURCE -#define _XOPEN_SOURCE 600 -#include - #include "lib/lib.h" #include "toys/e2fs.h" -- cgit v1.2.3