aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormwturvey <michael.w.turvey@intel.com>2017-03-15 15:31:17 -0700
committermwturvey <michael.w.turvey@intel.com>2017-03-15 15:31:17 -0700
commita409645cd3e2b8f0cc67541a9e4c88bf2cd96a79 (patch)
tree9e517b6b2b77e10bbaf589be9759dab27004c831 /include
parent1caa844dad647b03cf3c1d11bf211e9fcde4b7f1 (diff)
downloadlibsurvive-a409645cd3e2b8f0cc67541a9e4c88bf2cd96a79.tar.gz
libsurvive-a409645cd3e2b8f0cc67541a9e4c88bf2cd96a79.tar.bz2
Building & basic running
Diffstat (limited to 'include')
-rw-r--r--include/libsurvive/survive.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/libsurvive/survive.h b/include/libsurvive/survive.h
index db04a9d..2663c57 100644
--- a/include/libsurvive/survive.h
+++ b/include/libsurvive/survive.h
@@ -147,10 +147,10 @@ void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode
#elif defined(_MSC_VER)
#pragma section(".CRT$XCU",read)
#define INITIALIZER2_(f,p) \
- static void f(void); \
+ __declspec(dllexport) void f(void); \
__declspec(allocate(".CRT$XCU")) void (*f##_)(void) = f; \
__pragma(comment(linker,"/include:" p #f "_")) \
- static void f(void)
+ void f(void)
#ifdef _WIN64
#define INITIALIZER(f) INITIALIZER2_(f,"")
#else
@@ -163,11 +163,19 @@ void survive_default_angle_process( SurviveObject * so, int sensor_id, int acode
#endif
// End macros from StackOverflow.
+//static void foo(void)
+//{
+// int a=0;
+//}
+//
+//INITIALIZER(foo);
+
void RegisterDriver( const char * name, void * data );
#define REGISTER_LINKTIME( func ) \
- INITIALIZER(LTRegister##func) { RegisterDriver( #func, &func ); }
+ __declspec(dllexport) void LTRegister##func() { RegisterDriver( #func, &func ); } \
+ INITIALIZER(LTRegister##func)