Browse Source

Fix compilation with Xcode

NX 6 years ago
parent
commit
8c368baa9e
1 changed files with 2 additions and 3 deletions
  1. 2 3
      Source/Native/enet.h

+ 2 - 3
Source/Native/enet.h

@@ -972,9 +972,8 @@ extern "C" {
 			#define ENET_ATOMIC_CAS(ptr, old_value, new_value)                                                                   \
 			#define ENET_ATOMIC_CAS(ptr, old_value, new_value)                                                                   \
 				({                                                                                                               \
 				({                                                                                                               \
 					typeof(*(ptr)) ENET_ATOMIC_CAS_old_actual_ = (*(ptr));                                                       \
 					typeof(*(ptr)) ENET_ATOMIC_CAS_old_actual_ = (*(ptr));                                                       \
-					if (ATOMIC_CAS_old_actual_ == (old_value)) {                                                                 \
+					if (ATOMIC_CAS_old_actual_ == (old_value))                                                                   \
 						*(ptr) = new_value;                                                                                      \
 						*(ptr) = new_value;                                                                                      \
-					}                                                                                                            \
 					ENET_ATOMIC_CAS_old_actual_;                                                                                 \
 					ENET_ATOMIC_CAS_old_actual_;                                                                                 \
 				})
 				})
 			#else
 			#else
@@ -4146,7 +4145,7 @@ extern "C" {
 
 
 			return 0;
 			return 0;
 		}
 		}
-	#elif __APPLE__ && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200
+	#elif __APPLE__ && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 && !defined(CLOCK_MONOTONIC)
 		#define CLOCK_MONOTONIC 0
 		#define CLOCK_MONOTONIC 0
 
 
 		int clock_gettime(int X, struct timespec* ts) {
 		int clock_gettime(int X, struct timespec* ts) {