]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/test-cases/crt-custom/main.c
dyld-360.22.tar.gz
[apple/dyld.git] / unit-tests / test-cases / crt-custom / main.c
index 0986fd082648611c77b8e6489361a61f0d766d84..29c79cf8cd6e5ce81b96b79d7c787dd7ec804a25 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2007-2009 Apple Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -23,6 +23,7 @@
 #include <stdio.h>  // fprintf(), NULL
 #include <stdlib.h> // exit(), EXIT_SUCCESS
 #include <dlfcn.h>
+#include <Availability.h>
 
 #include "test.h" // PASS(), FAIL(), XPASS(), XFAIL()
 
@@ -34,10 +35,15 @@ int flag = 0;
        // for 64-bit binaries initializers are always called before entry point
        #define ENTRY_BEFORE_INIT 0
 #else
-       // for pre 10.5, 32-bit binaries, entry point is called which then calls initializers
-       #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
-               #define ENTRY_BEFORE_INIT 1
+       #if __MAC_OS_X_VERSION_MIN_REQUIRED
+               // for pre 10.5, 32-bit binaries, entry point is called which then calls initializers
+               #if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_5
+                       #define ENTRY_BEFORE_INIT 1
+               #else
+                       #define ENTRY_BEFORE_INIT 0
+               #endif
        #else
+               // for iPhoneOS, initializers are always called before entry point
                #define ENTRY_BEFORE_INIT 0
        #endif
 #endif