int module_close(struct module_entry_t *m);
int modules_shutdown(void);
+extern void *utility_memcpy_ptr; /* This gets us through the ISO C warnings about our POSIX compliance macros */
/* Iterate through Module List */
#define MODULE_ITER(m) for(m = module_list ; m != NULL ; m = m->next)
/* Retrieve Module Function */
/* This Macro can only be used for non-returning calls */
#define MODULE_FUNC(h, m, func, ...) \
- if((h = (void (*)()) lt_dlsym(m, func))) { \
+ utility_memcpy_ptr = lt_dlsym(m, func); \
+ memcpy(&h, &utility_memcpy_ptr, sizeof(utility_memcpy_ptr)); \
+ if(h) { \
h(__VA_ARGS__); \
}
+
#define MODULE_FUNC_NOARGS(h, m, func) \
- if((h = (void (*)()) lt_dlsym(m, func))) { \
+ utility_memcpy_ptr = lt_dlsym(m, func); \
+ memcpy(&h, &utility_memcpy_ptr, sizeof(utility_memcpy_ptr)); \
+ if(h) { \
h(); \
}
#define MODULE_FUNCRET(m, func) lt_dlsym(m, func);
-
#endif /* _MODULES_H_ */
struct module_entry_t *module_list = NULL;
+/* Utility power for my macros... This gets us through the ISO C warnings about our posix compliance issues.. */
+void *utility_memcpy_ptr;
+
/* Ads a module entry and returns */
struct module_entry_t *module_entry_add(char *name) {
struct module_entry_t *entry;