Browse Source

Up to date with NX repo: 4152f12

Matthew Coburn 6 years ago
parent
commit
70f0a69751
2 changed files with 8 additions and 6 deletions
  1. 3 1
      Source/Native/CMakeLists.txt
  2. 5 5
      Source/Native/enet.h

+ 3 - 1
Source/Native/CMakeLists.txt

@@ -20,6 +20,7 @@ if (ENET_STATIC)
 
     if (WIN32)
         target_link_libraries(enet_static winmm ws2_32)
+        SET_TARGET_PROPERTIES(enet_static PROPERTIES PREFIX "")
     endif()
 endif()
 
@@ -29,5 +30,6 @@ if (ENET_SHARED)
 
     if (WIN32)
         target_link_libraries(enet winmm ws2_32)
+        SET_TARGET_PROPERTIES(enet PROPERTIES PREFIX "")
     endif()
-endif()
+endif()

+ 5 - 5
Source/Native/enet.h

@@ -4461,13 +4461,13 @@ extern "C" {
 		}
 
 		ENetSocket enet_socket_create(ENetSocketType type) {
-			#ifdef __APPLE__
-				int cloexec = 0;
-			#else
-				int cloexec = SOCK_CLOEXEC;
+			int socketType = (type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM);
+
+			#ifdef SOCK_CLOEXEC
+				socketType |= SOCK_CLOEXEC;
 			#endif
 
-			return socket(PF_INET6, (type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM) | cloexec, 0);
+			return socket(PF_INET6, socketType, 0);
 		}
 
 		int enet_socket_set_option(ENetSocket socket, ENetSocketOption option, int value) {