summaryrefslogtreecommitdiffstats
path: root/shlibs/blkid/src/read.c
diff options
context:
space:
mode:
Diffstat (limited to 'shlibs/blkid/src/read.c')
-rw-r--r--shlibs/blkid/src/read.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/shlibs/blkid/src/read.c b/shlibs/blkid/src/read.c
index e6aa08368..3ff9ebe9f 100644
--- a/shlibs/blkid/src/read.c
+++ b/shlibs/blkid/src/read.c
@@ -10,7 +10,6 @@
* %End-Header%
*/
-#define _XOPEN_SOURCE 600 /* for inclusion of strtoull */
#include <stdio.h>
#include <ctype.h>
@@ -26,6 +25,13 @@
#include "blkidP.h"
+#if HAVE_STDLIB_H
+# ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 600 /* for inclusion of strtoull */
+# endif
+# include <stdlib.h>
+#endif
+
#ifdef HAVE_STRTOULL
#define STRTOULL strtoull /* defined in stdlib.h if you try hard enough */
#else
@@ -33,10 +39,6 @@
#define STRTOULL strtoul
#endif
-#if HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
#ifdef TEST_PROGRAM
#define blkid_debug_dump_dev(dev) (debug_dump_dev(dev))
static void debug_dump_dev(blkid_dev dev);