]> git.saurik.com Git - apple/dyld.git/blob - unit-tests/test-cases/upward-dylib-init-order/common.c
dyld-210.2.3.tar.gz
[apple/dyld.git] / unit-tests / test-cases / upward-dylib-init-order / common.c
1 #include "common.h"
2 #include <stdio.h>
3
4 static bool b = false;
5 static bool u = false;
6 static bool isOk = true;
7
8 void setB()
9 {
10 if ( u || b )
11 isOk = false;
12 b = true;
13 }
14
15 void setU()
16 {
17 if ( u )
18 isOk = false;
19 u = true;
20 }
21
22 // return true iff
23 // setB() was called, then setU()
24 bool ok()
25 {
26 //fprintf(stderr, "isOk=%d, u=%d, b=%d\n", isOk, u, b);
27 return isOk && u && b;
28 }
29