Browse Source

Include guard for IPv4-mapped IPv6 structure

NX 6 years ago
parent
commit
b52147736d
1 changed files with 11 additions and 6 deletions
  1. 11 6
      Source/Native/enet.h

+ 11 - 6
Source/Native/enet.h

@@ -169,12 +169,6 @@
 	#define ENET_BUFFER_MAXIMUM (1 + 2 * ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS)
 #endif
 
-struct in4_addr {
-	uint8_t zeros[10];
-	uint16_t ffff;
-	struct in_addr ip;
-};
-
 /* Macros */
 
 #define ENET_HOST_ANY in6addr_any
@@ -190,6 +184,17 @@ struct in4_addr {
 extern "C" {
 #endif
 
+	#ifndef IN4ADDR
+	#define IN4ADDR
+
+	struct in4_addr {
+		uint8_t zeros[10];
+		uint16_t ffff;
+		struct in_addr ip;
+	};
+
+	#endif
+
 /*
 =======================================================================