2 * JUCE LV2 *.ttl generator
7 #if defined(_WIN32) || defined (_WIN64)
9 #define TTL_GENERATOR_WINDOWS
14 typedef void (*TTL_Generator_Function
)(void);
16 int main(int argc
, char *argv
[])
19 printf("usage: %s /path/to/binary.so\n", argv
[0]);
23 #ifdef TTL_GENERATOR_WINDOWS
24 void* handle
= LoadLibrary(argv
[1]);
26 void* handle
= dlopen(argv
[1], RTLD_LAZY
);
30 #ifdef TTL_GENERATOR_WINDOWS
31 printf("Failed to open library\n");
33 printf("Failed to open library, error was:\n%s\n", dlerror());
38 #ifdef TTL_GENERATOR_WINDOWS
39 TTL_Generator_Function ttl_fcn
= (TTL_Generator_Function
)GetProcAddress((HMODULE
)handle
, "juce_lv2_ttl_generator");
41 TTL_Generator_Function ttl_fcn
= (TTL_Generator_Function
)dlsym(handle
, "juce_lv2_ttl_generator");
47 printf("Failed to find 'juce_lv2_ttl_generator' function\n");
50 #ifdef TTL_GENERATOR_WINDOWS
51 FreeLibrary((HMODULE
)handle
);