Mercurial > pub > dyncall > dyncall
comparison test/resolve_self/main.c @ 227:318a9ffc2b85
- resolve_self test cleanups
author | Tassilo Philipp |
---|---|
date | Sun, 16 Apr 2017 13:29:36 +0200 |
parents | 0592eb360af2 |
children | f5577f6bf97a |
comparison
equal
deleted
inserted
replaced
226:6e40eb9fb261 | 227:318a9ffc2b85 |
---|---|
44 int main(int argc, char* argv[]) | 44 int main(int argc, char* argv[]) |
45 { | 45 { |
46 void* address; | 46 void* address; |
47 double result; | 47 double result; |
48 int status; | 48 int status; |
49 DLSyms* pSyms; | |
49 DLLib* pLib = dlLoadLibrary(NULL); | 50 DLLib* pLib = dlLoadLibrary(NULL); |
50 assert(pLib); | 51 assert(pLib); |
51 printf("self loaded at %p\n", pLib); | 52 printf("self loaded at %p\n", pLib); |
52 | 53 |
53 address = dlFindSymbol(pLib, "add_dd_d"); | 54 address = dlFindSymbol(pLib, "add_dd_d"); |
57 status = (result == 23); | 58 status = (result == 23); |
58 } else { | 59 } else { |
59 printf("can't resolve address of add_dd_d, it doesn't seem to be a *dynamic* symbol\n"); | 60 printf("can't resolve address of add_dd_d, it doesn't seem to be a *dynamic* symbol\n"); |
60 status = 0; | 61 status = 0; |
61 } | 62 } |
63 | |
64 dlFreeLibrary(pLib); | |
65 | |
66 /*pSyms = dlSymsInit(NULL); | |
67 printf("syms handle: %p\n", pSyms); | |
68 dlSymsCleanup(pSyms);*/ | |
69 | |
62 printf("result: resolve_self: %d\n", status); | 70 printf("result: resolve_self: %d\n", status); |
63 return 0; | 71 return 0; |
64 } | 72 } |
73 |