#ifndef DEFINES_H
# define DEFINES_H
-#include <config.h>
-
-#ifdef STDC_HEADERS
-# include <string.h>
-# include <stdlib.h>
-# include <stdio.h>
-# include <ctype.h>
+#if HAVE_CONFIG_H
+# include <config.h>
#endif
+#include <stddef.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+
#ifdef NO_SSIZE_T
# define HAVE_SSIZE_T
typedef int ssize_t;
# include <strings.h>
#endif
-#include <memmem.h>
-
-#ifdef HAVE_STDDEF_H
-# include <stddef.h>
-#endif
-
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
# include <sys/socket.h>
#endif
+#include "memmem.h"
+
#ifndef HAVE_UINT
typedef unsigned int uint;
typedef signed int sint;