]> git.seodisparate.com - UDPConnection/commitdiff
Rename PLATFORM macro to "namespace" UDPC_
authorStephen Seo <seo.disparate@gmail.com>
Sat, 26 Jan 2019 07:49:54 +0000 (16:49 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Sat, 26 Jan 2019 07:49:54 +0000 (16:49 +0900)
src/UDPConnection.c
src/UDPConnection.h

index a78aa1819a6bd3ef87a07df9807c913c1e4c2880..df402740d86a5bf480a06f3a50770a7af75fe053 100644 (file)
@@ -37,11 +37,11 @@ UDPC_Context UDPC_init(unsigned short listenPort)
     }
 
     // set nonblocking on socket
-#if PLATFORM == PLATFORM_MAC || PLATFORM == PLATFORM_LINUX
+#if UDPC_PLATFORM == UDPC_PLATFORM_MAC || UDPC_PLATFORM == UDPC_PLATFORM_LINUX
     int nonblocking = 1;
     if(fcntl(context.socketHandle, F_SETFL, O_NONBLOCK, nonblocking) == -1)
     {
-#elif PLATFORM == PLATFORM_WINDOWS
+#elif UDPC_PLATFORM == UDPC_PLATFORM_WINDOWS
     DWORD nonblocking = 1;
     if(ioctlsocket(context.socketHandle, FIONBIO, &nonblocking) != 0)
     {
index 15e3954279355ed570e1fc681a7b0da4173f39fc..036a4f5758c5725b3f33b96fca488d64f681ad07 100644 (file)
@@ -4,26 +4,26 @@
 #include <stdio.h>
 #include <threads.h>
 
-#define PLATFORM_WINDOWS 1
-#define PLATFORM_MAC 2
-#define PLATFORM_LINUX 3
-#define PLATFORM_UNKNOWN 0
+#define UDPC_PLATFORM_WINDOWS 1
+#define UDPC_PLATFORM_MAC 2
+#define UDPC_PLATFORM_LINUX 3
+#define UDPC_PLATFORM_UNKNOWN 0
 
 #if defined _WIN32
-  #define PLATFORM PLATFORM_WINDOWS
+  #define UDPC_PLATFORM UDPC_PLATFORM_WINDOWS
 #elif defined __APPLE__
-  #define PLATFORM PLATFORM_MAC
+  #define UDPC_PLATFORM UDPC_PLATFORM_MAC
 #elif defined __linux__
-  #define PLATFORM PLATFORM_LINUX
+  #define UDPC_PLATFORM UDPC_PLATFORM_LINUX
 #else
-  #define PLATFORM PLATFORM_UNKNOWN
+  #define UDPC_PLATFORM UDPC_PLATFORM_UNKNOWN
 #endif
 
-#if PLATFORM == PLATFORM_WINDOWS
+#if UDPC_PLATFORM == UDPC_PLATFORM_WINDOWS
   #include <winsock2.h>
 
   #define CleanupSocket(x) closesocket(x)
-#elif PLATFORM == PLATFORM_MAC || PLATFORM == PLATFORM_LINUX
+#elif UDPC_PLATFORM == UDPC_PLATFORM_MAC || UDPC_PLATFORM == UDPC_PLATFORM_LINUX
   #include <sys/socket.h>
   #include <netinet/in.h>
   #include <fcntl.h>