unit-tests: Change how hashtable for testable functions is created

Because GCC does not adhere to the priorities defined for constructors
when building with --enable-monolithic (not sure if it was just luck
that it worked in non-monolithic mode - anyway, it's not very portable)
function registration would fail because the hashtable would not be
created yet.
This commit is contained in:
Tobias Brunner
2014-03-20 15:29:27 +01:00
parent d151cd283e
commit f51169eb09
3 changed files with 49 additions and 28 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ void testable_function_register(char *name, void *fn);
* @param fn function to register
*/
#define EXPORT_FUNCTION_FOR_TESTS(ns, fn) \
static void testable_function_register_##fn() __attribute__ ((constructor(2000))); \
static void testable_function_register_##fn() __attribute__ ((constructor)); \
static void testable_function_register_##fn() \
{ \
testable_function_register(#ns "/" #fn, fn); \