collectdctl: Reorder includes and set strict C99/POSIX mode.
authorFlorian Forster <octo@huhu.verplant.org>
Wed, 18 Aug 2010 08:22:36 +0000 (10:22 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Wed, 18 Aug 2010 08:23:37 +0000 (10:23 +0200)
This enables NAN on some systems, e.g. old Linux boxes.

src/collectdctl.c

index fe11881..bb7cfca 100644 (file)
  *   Sebastian "tokkee" Harl <sh@tokkee.org>
  **/
 
+#ifndef _ISOC99_SOURCE
+# define _ISOC99_SOURCE
+#endif
+
+#ifndef _POSIX_C_SOURCE
+# define _POSIX_C_SOURCE 200112L
+#endif
+
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 600
+#endif
+
 #if HAVE_CONFIG_H
 # include "config.h"
 #endif
 
-#include "libcollectdclient/client.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <strings.h>
 
 #include <assert.h>
-
 #include <errno.h>
-
-#include <getopt.h>
-
 #include <math.h>
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "libcollectdclient/client.h"
 
-#include <unistd.h>
 
 #define DEFAULT_SOCK LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock"