meson: Add tls-interaction test, and fix giomodule test

giomodule test needed symbol visibility pragmas added. This is needed on
Windows anyway, so it's better to do it this way rather than disabling
-fvisibility=hidden for the test modules.
This commit is contained in:
Nirbheek Chauhan
2016-12-21 07:46:30 +05:30
committed by Matthias Clasen
parent e2da3cb599
commit 122f4c051d
4 changed files with 32 additions and 4 deletions

View File

@@ -0,0 +1,16 @@
#ifndef GLIB_TEST_SYMBOL_VISIBILITY
#define GLIB_TEST_SYMBOL_VISIBILITY
/* This is the same check that's done in configure to create config.h */
#ifdef _WIN32
# ifdef _MSC_VER
# define GLIB_TEST_EXPORT_SYMBOL __declspec(dllexport) extern
# else
# define GLIB_TEST_EXPORT_SYMBOL __attribute__((visibility("default"))) __declspec(dllexport) extern
# endif
/* Matches GCC and Clang */
#elif defined(__GNUC__) && (__GNUC__ >= 4)
# define GLIB_TEST_EXPORT_SYMBOL __attribute__((visibility("default"))) extern
#endif
#endif /* GLIB_TEST_SYMBOL_VISIBILITY */

View File

@@ -22,6 +22,8 @@
#include <gio/gio.h>
#include "symbol-visibility.h"
typedef struct _TestA {
GObject parent;
} TestA;
@@ -42,7 +44,7 @@ test_a_init (TestA *self)
{
}
void
GLIB_TEST_EXPORT_SYMBOL void
g_io_module_load (GIOModule *module)
{
g_io_extension_point_implement ("test-extension-point",
@@ -51,7 +53,7 @@ g_io_module_load (GIOModule *module)
30);
}
void
GLIB_TEST_EXPORT_SYMBOL void
g_io_module_unload (GIOModule *module)
{
}

View File

@@ -22,6 +22,8 @@
#include <gio/gio.h>
#include "symbol-visibility.h"
typedef struct _TestB {
GObject parent;
} TestB;
@@ -42,7 +44,7 @@ test_b_init (TestB *self)
{
}
void
GLIB_TEST_EXPORT_SYMBOL void
g_io_module_load (GIOModule *module)
{
g_io_extension_point_implement ("test-extension-point",
@@ -51,7 +53,7 @@ g_io_module_load (GIOModule *module)
40);
}
void
GLIB_TEST_EXPORT_SYMBOL void
g_io_module_unload (GIOModule *module)
{
}