]> PatchyGit - patchyircd.git/commitdiff
simplify win32 defines
authorEgor <egor@patchysicp.xyz>
Tue, 17 May 2022 19:50:55 +0000 (22:50 +0300)
committerEgor <egor@patchysicp.xyz>
Tue, 17 May 2022 19:50:55 +0000 (22:50 +0300)
NetSock/netsock.h
config.example.mk
main.c

index 8d56d74..28a493b 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _netsock_h
 #define _netsock_h
 #define FD_SETSIZE 1024
+#if _WIN32
+#define WINVER 0x0600
+#define _WIN32_WINNT 0x0600
+#endif
 
 // Standard headers
 #include <stdio.h>
 
 // Windows
 #if defined(_WIN32)
-#ifndef I_KNOW_HOW_TO_USE_A_LINKER
-#pragma message("Warning: Windows detected.")
-#pragma message("IMPORTANT: COMPILE WITH -lws2_32")
-#pragma comment(lib, "ws2_32.lib")
-#endif
-//#include <WinSock2.h>
-//#include <WS2tcpip.h>
-//#include <Windows.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include <windows.h>
 #ifdef _WIN64
-//#define PRISocket "lu" // The format string for SOCKET
 #define PRISocket "llu" // The format string for SOCKET
 #else
 #define PRISocket "u" // The format string for SOCKET
index 9bb7a5e..84b508b 100644 (file)
@@ -3,5 +3,5 @@ CC=clang
 CFLAGS=-Wall -Wextra -DHAS_TLS
 LDLIBS=-ltls
 CC.w32=i686-w64-mingw32-gcc
-CFLAGS.w32=-Wall -Wextra -DI_KNOW_HOW_TO_USE_A_LINKER -DWINVER=0x0600 -D_WIN32_WINNT=0x0600
+CFLAGS.w32=-Wall -Wextra
 LDLIBS.w32=-lws2_32
diff --git a/main.c b/main.c
index 48f301b..37310ec 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1,7 +1,7 @@
-#include <locale.h>
 #include "common.h"
 #include "net.h"
 #include "irc.h"
+#include <locale.h>
 
 #ifndef _WIN32
 #include <signal.h>