#ifdef HAVE_STDLIB_H
#include <stdlib.h>
+#else
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <string.h>
#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
#include <time.h>