typedef void (*function)(); struct foo { function get; }; __declspec(dllimport) void f1(); struct foo f = { #ifndef WORKAROUND f1 #else 0 #endif }; void init() { #ifdef WORKAROUND f.get = f1; #endif }