#ifdef _WIN32 #define DLLEXPORT __declspec( dllexport ) #else #define DLLEXPORT #endif typedef int (*multiply_by_two_func)( int ); DLLEXPORT int multiply_by_two( int a ); int multiply_by_two( int a ) { return a * 2; } extern int DLLEXPORT seven; int seven = 7; typedef struct { int major; int minor; multiply_by_two_func func; } module_descriptor_t; extern DLLEXPORT module_descriptor_t mod_descr; module_descriptor_t mod_descr = { 1, 0, &multiply_by_two };