Explorar o código

Next attempt to fix civetweb for XCode 8.

Lasse Öörni %!s(int64=9) %!d(string=hai) anos
pai
achega
eb62fd941b
Modificáronse 1 ficheiros con 4 adicións e 15 borrados
  1. 4 15
      Source/ThirdParty/Civetweb/src/civetweb.c

+ 4 - 15
Source/ThirdParty/Civetweb/src/civetweb.c

@@ -20,7 +20,7 @@
  * THE SOFTWARE.
  */
 
-// Modified by cosmy1, Yao Wei Tjong, Lasse Oorni & Josh Engebretson for Urho3D
+// Modified by cosmy1, Yao Wei Tjong & Lasse Oorni for Urho3D
 
 #if defined(_WIN32)
 #if !defined(_CRT_SECURE_NO_WARNINGS)
@@ -123,6 +123,9 @@ mg_static_assert(sizeof(void *) >= sizeof(int), "data type size check");
 
 #ifdef __MACH__
 
+// Urho3D: prefer own implementation of clock_gettime regardless of XCode / SDK version
+#define _DARWIN_FEATURE_CLOCK_GETTIME 0
+
 #define CLOCK_MONOTONIC (1)
 #define CLOCK_REALTIME (2)
 
@@ -132,19 +135,6 @@ mg_static_assert(sizeof(void *) >= sizeof(int), "data type size check");
 #include <mach/mach_time.h>
 #include <assert.h>
 
-/* Determine if the current OSX version supports clock_gettime */
-#ifdef __APPLE__
-#include <AvailabilityMacros.h>
-#ifndef MAC_OS_X_VERSION_10_12
-#define MAC_OS_X_VERSION_10_12 101200
-#endif
-#endif
-
-// Urho3D: Instead of using MAC_OS_X_VERSION_MIN_REQUIRED, which it doesn't appear time.h is guarded by, use MAC_OS_X_VERSION_MAX_ALLOWED
-#define CIVETWEB_APPLE_HAVE_CLOCK_GETTIME defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12
-#if !(CIVETWEB_APPLE_HAVE_CLOCK_GETTIME)
-int clock_gettime(int clk_id, struct timespec *t);
-
 int clock_gettime(int clk_id, struct timespec *t)
 {
 	if (clk_id == CLOCK_REALTIME) {
@@ -185,7 +175,6 @@ int clock_gettime(int clk_id, struct timespec *t)
 	return -1; /* EINVAL - Clock ID is unknown */
 }
 #endif
-#endif
 
 // Urho3D: Prevent inclusion of pthread_time.h on MinGW, instead prefer own implementation of clock_gettime()
 // to prevent dependency on pthread library which is not needed otherwise