More header fiddling: crypt.h is silly, SUSv4 requires crypt() to be prototyped in...
authorRob Landley <rob@landley.net>
Sat, 16 Jun 2012 19:19:56 +0000 (14:19 -0500)
committerRob Landley <rob@landley.net>
Sat, 16 Jun 2012 19:19:56 +0000 (14:19 -0500)
lib/portability.h
toys.h

index 9b8d294..92d8f96 100644 (file)
@@ -9,21 +9,18 @@
 
 #define _FILE_OFFSET_BITS 64
 
-#include <features.h>
-
-//#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 <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__
diff --git a/toys.h b/toys.h
index 34cf035..a333986 100644 (file)
--- a/toys.h
+++ b/toys.h
@@ -8,7 +8,6 @@
 
 #include "lib/portability.h"
 
-#include <crypt.h>
 #include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
 #include <sys/statvfs.h>
 #include <sys/sysinfo.h>
 #include <sys/swap.h>
+#include <sys/times.h>
 #include <sys/types.h>
 #include <sys/utsname.h>
 #include <sys/wait.h>
 #include <syslog.h>
+#include <time.h>
 #include <unistd.h>
 #include <utime.h>
 #include <utmpx.h>
 
-#undef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 600
-#include <time.h>
-
 #include "lib/lib.h"
 #include "toys/e2fs.h"