]> granicus.if.org Git - fortune-mod/commitdiff
refactoring: consolidate ifdefs
authorShlomi Fish <shlomif@shlomifish.org>
Sat, 20 Nov 2021 06:54:54 +0000 (08:54 +0200)
committerShlomi Fish <shlomif@shlomifish.org>
Sat, 20 Nov 2021 06:54:54 +0000 (08:54 +0200)
fortune-mod/util/fortune-mod-common.h

index 758af25cfcfe4b2e71d890b97d9fd501ec8e77db..e6d479adeddc2d7df6d01242c126eddc456449d7 100644 (file)
 #pragma once
 #include <sys/types.h>
 #include <sys/stat.h>
-/* For ntohl() */
 #ifdef _WIN32
+/* For ntohl() */
 #include <winsock2.h>
 #define getpid() 0
+#include <windows.h>
+#include "getopt.h"
+#define random(x) rand(x)
+#define srandom(x) srand(x)
+#define sleep(n) Sleep((n)*1000)
 #else
 #include <arpa/inet.h>
 #include <unistd.h>
 #ifndef MAXPATHLEN
 #define MAXPATHLEN 1024
 #endif /* MAXPATHLEN */
-#if defined(_WIN32)
-#include <windows.h>
-#include "getopt.h"
-#define random(x) rand(x)
-#define srandom(x) srand(x)
-#define sleep(n) Sleep((n)*1000)
-#endif
 #include <rinutils/count.h>
 #include <rinutils/unused.h>