tests: introduce a small hack for visibility
authorRyan Lortie <desrt@desrt.ca>
Mon, 14 Jan 2013 05:13:00 +0000 (00:13 -0500)
committerRyan Lortie <desrt@desrt.ca>
Mon, 14 Jan 2013 05:13:00 +0000 (00:13 -0500)
One of our testcases builds a small giomodule for testing the loading of
modules containing resources.  Unfortunately, this module gets built
using the same CFLAGS as the rest of GLib, including the visibility
flags (defaulting to hidden).

Use "config.h" to get a declaration of _GLIB_EXTERN that will export
symbols properly and use it to annotate the necessary APIs.

gio/tests/resourceplugin.c

index b66d541..9e3b704 100644 (file)
@@ -1,16 +1,18 @@
+#include "config.h"
+
 #include <gio/gio.h>
 
-void
+_GLIB_EXTERN void
 g_io_module_load (GIOModule *module)
 {
 }
 
-void
+_GLIB_EXTERN void
 g_io_module_unload (GIOModule   *module)
 {
 }
 
-char **
+_GLIB_EXTERN char **
 g_io_module_query (void)
 {
   return NULL;