Browse Source

Use Apple's Availability.h directly to determine current OS X version

Nick Stenning 13 years ago
parent
commit
a0739a94db
1 changed files with 5 additions and 1 deletions
  1. 5 1
      dulwich/_objects.c

+ 5 - 1
dulwich/_objects.c

@@ -21,11 +21,15 @@
 #include <stdlib.h>
 #include <sys/stat.h>
 
+#if defined(__APPLE__)
+#include <Availability.h>
+#endif
+
 #if (PY_VERSION_HEX < 0x02050000)
 typedef int Py_ssize_t;
 #endif
 
-#if defined(__MINGW32_VERSION) || (defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+#if defined(__MINGW32_VERSION) || (defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
 size_t strnlen(char *text, size_t maxlen)
 {
 	const char *last = memchr(text, '\0', maxlen);