X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/9e225d036f7ada46c87f40647ed12d4c406f502f..19894a1236eae932b4028640f24ab843f691d4e4:/unit-tests/test-cases/bundle-memory-load-fat/main.c diff --git a/unit-tests/test-cases/bundle-memory-load-fat/main.c b/unit-tests/test-cases/bundle-memory-load-fat/main.c index 4d77c98..05ef670 100644 --- a/unit-tests/test-cases/bundle-memory-load-fat/main.c +++ b/unit-tests/test-cases/bundle-memory-load-fat/main.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "test.h" // PASS(), FAIL() @@ -35,6 +36,8 @@ typedef bool (*CheckFunc)(); int main() { +// NSObjectFileImage APIs only available on Mac OS X - not iPhone OS +#if __MAC_OS_X_VERSION_MIN_REQUIRED int fd = open("test.bundle", O_RDONLY, 0); if ( fd == -1 ) { FAIL("open() failed"); @@ -74,7 +77,7 @@ int main() } CheckFunc func = NSAddressOfSymbol(sym); - if ( !func() ) { + if ( func == NULL ) { FAIL("NSAddressOfSymbol failed"); return 1; } @@ -90,6 +93,7 @@ int main() } // Should check that loadAddress is unmmaped now (by call to NSDestroyObjectFileImage) +#endif PASS("bundle-memory-load-fat"); return 0;