]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-in-init3.dtest/bar.c
6 static void* bazHandle
= NULL
;
7 static void* bazSymbol
= NULL
;
8 static int barInited
= 0;
9 static int bazInited
= 0;
11 __attribute__((constructor
))
15 bazHandle
= dlopen(RUN_DIR
"/libbaz.dylib", 0);
16 if ( bazHandle
== NULL
) {
17 printf("[FAIL] dlopen-in-init3, dlopen libbaz.dylib: %s\n", dlerror());
20 bazSymbol
= dlsym(RTLD_DEFAULT
, "bazIsInited");
21 if ( bazSymbol
== NULL
) {
22 printf("[FAIL] dlopen-in-init3, dlsym libbaz.dylib\n");
25 bazInited
= ((int(*)())bazSymbol
)();
29 if ( barInited
== 0 ) {
30 printf("[FAIL] dlopen-in-init3, didn't init bar\n");
33 if ( bazHandle
== NULL
) {
36 if ( bazSymbol
== NULL
) {
39 if ( bazInited
== 0 ) {
40 printf("[FAIL] dlopen-in-init3, didn't init bar\n");