From a409645cd3e2b8f0cc67541a9e4c88bf2cd96a79 Mon Sep 17 00:00:00 2001 From: mwturvey Date: Wed, 15 Mar 2017 15:31:17 -0700 Subject: Building & basic running --- include/libsurvive/survive.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'include') 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) -- cgit v1.2.3