|
|
| version 1.1.1.1, 2012/02/21 22:57:48 | version 1.1.1.2, 2012/05/29 09:29:43 |
|---|---|
| Line 95 | Line 95 |
| /* Ensure that the variable x is exported from the library, and that a | /* Ensure that the variable x is exported from the library, and that a |
| pseudo-variable IMP(x) is available. */ | pseudo-variable IMP(x) is available. */ |
| #define VARIABLE(x) \ | #define VARIABLE(x) \ |
| /* Export x without redefining x. This code was found by compiling a \ | /* Export x without redefining x. This code was found by compiling a \ |
| snippet: \ | snippet: \ |
| extern __declspec(dllexport) int x; int x = 42; */ \ | extern __declspec(dllexport) int x; int x = 42; */ \ |
| asm (".section .drectve\n"); \ | asm (".section .drectve\n"); \ |
| asm (".ascii \" -export:" #x ",data\"\n"); \ | asm (".ascii \" -export:" #x ",data\"\n"); \ |
| asm (".data\n"); \ | asm (".data\n"); \ |
| /* Allocate a pseudo-variable IMP(x). */ \ | /* Allocate a pseudo-variable IMP(x). */ \ |
| extern int x; \ | extern int x; \ |
| void * IMP(x) = &x; | void * IMP(x) = &x; |