The major() cpp macro is defined as requiring sys/types.h to be
included with _BSD_SOURCE defined. However, in older glibc's this
hasn't been strictly required and the stdlib.h header file included
sys/types.h implicitly. Fix this so that more aggressive
distributions run into build errors.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
in with andchanges. Lines starting
* %End-Header%
*/
+/* define BSD_SOURCE to make sure we get the major() macro */
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE
+#endif
+#ifndef _DEFAULT_SOURCE
+#define _DEFAULT_SOURCE /* since glibc 2.20 _SVID_SOURCE is deprecated */
+#endif
+
#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#endif /* HAVE_GETMNTINFO */
#include <string.h>
#include <sys/stat.h>
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
#include "ext2_fs.h"
#include "ext2fs.h"