Browse Source

Update to NX's repo, commit hash 7f01780

Matthew Coburn 6 years ago
parent
commit
64af753164
4 changed files with 4 additions and 14 deletions
  1. 0 2
      Source/Managed/ENet.cs
  2. 2 7
      Source/Native/CMakeLists.txt
  3. 0 1
      Source/Native/enet.c
  4. 2 4
      Source/Native/enet.h

+ 0 - 2
Source/Managed/ENet.cs

@@ -65,7 +65,6 @@ namespace ENet {
 		[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
 		public byte[] ip;
 		public ushort port;
-		public ushort scope;
 	}
 
 	[StructLayout(LayoutKind.Sequential)]
@@ -677,7 +676,6 @@ namespace ENet {
 					return Encoding.ASCII.GetString(ip, 0, ip.StringLength());
 				else
 					return String.Empty;
-				}
 			}
 		}
 

+ 2 - 7
Source/Native/CMakeLists.txt

@@ -6,12 +6,6 @@ set(ENET_STATIC "0" CACHE BOOL "Create a static library")
 set(ENET_SHARED "0" CACHE BOOL "Create a shared library")
 set(ENET_LZ4 "0" CACHE BOOL "Add support for an optional packet-level compression")
 
-if (MSVC)
-    add_definitions(-W3)
-else()
-    add_definitions(-Wno-error)
-endif()
-
 if (ENET_DEBUG)
     add_definitions(-DENET_DEBUG)
 endif()
@@ -30,9 +24,10 @@ if (ENET_STATIC)
 endif()
 
 if (ENET_SHARED)
+    add_definitions(-DENET_DLL)
     add_library(enet SHARED enet.c ${SOURCES})
 
     if (WIN32)
         target_link_libraries(enet winmm ws2_32)
     endif()
-endif()
+endif()

+ 0 - 1
Source/Native/enet.c

@@ -22,5 +22,4 @@
  */
 
 #define ENET_IMPLEMENTATION
-#define ENET_DLL
 #include "enet.h"

+ 2 - 4
Source/Native/enet.h

@@ -169,8 +169,6 @@
 	#define ENET_BUFFER_MAXIMUM (1 + 2 * ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS)
 #endif
 
-/* Macros */
-
 #define ENET_HOST_ANY in6addr_any
 #define ENET_PORT_ANY 0
 #define ENET_HOST_SIZE 1025
@@ -477,7 +475,7 @@ extern "C" {
 		uint16_t port;
 	} ENetAddress;
 
-	#define in6_equal(in6_addr_a, in6_addr_b) (memcmp(&in6_addr_a, &in6_addr_b, sizeof(struct in6_addr)) == 0)
+	#define in6_equal(a, b) (memcmp(&a, &b, sizeof(struct in6_addr)) == 0)
 
 	typedef enum _ENetPacketFlag {
 		ENET_PACKET_FLAG_NONE                  = 0,
@@ -5164,4 +5162,4 @@ extern "C" {
 }
 #endif
 #endif
-#endif
+#endif