]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/test-cases/NSAddImage-leafname/main.c
dyld-239.4.tar.gz
[apple/dyld.git] / unit-tests / test-cases / NSAddImage-leafname / main.c
index 28922aff37bb2522ea066230e6f4990f55c7232e..f1ad6308dff0b4a41564cbe7a34edfe4b8438608 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2005-2009 Apple Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
@@ -23,6 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <mach-o/dyld.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <mach-o/dyld.h>
+#include <Availability.h>
 
 #include "test.h"
 
 
 #include "test.h"
 
 
 int main()
 {
 
 int main()
 {
+// NSAddImage is only available on Mac OS X - not iPhone OS
+#if __MAC_OS_X_VERSION_MIN_REQUIRED
        // test that NSAddImage() uses fallback path when given a leaf name
        const struct mach_header * mh = NSAddImage("libzzz.dylib", NSADDIMAGE_OPTION_WITH_SEARCHING);
        // test that NSAddImage() uses fallback path when given a leaf name
        const struct mach_header * mh = NSAddImage("libzzz.dylib", NSADDIMAGE_OPTION_WITH_SEARCHING);
-       if ( mh != NULL )
-               PASS("NSAddImage-leafname");
-       else
+       if ( mh == NULL )
                FAIL("NSAddImage-leafname");
                FAIL("NSAddImage-leafname");
+       else
+#endif
+               PASS("NSAddImage-leafname");
        return EXIT_SUCCESS;
 }
        return EXIT_SUCCESS;
 }