mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-26 09:30:04 +01:00
Merge branch 'fix-module-tests-msvc' into 'master'
Fix module tests on Visual Studio builds See merge request GNOME/glib!937
This commit is contained in:
commit
45a21dcc3a
@ -22,6 +22,12 @@
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define MODULE_FILENAME_PREFIX ""
|
||||
#else
|
||||
# define MODULE_FILENAME_PREFIX "lib"
|
||||
#endif
|
||||
|
||||
static void
|
||||
test_extension_point (void)
|
||||
{
|
||||
@ -108,7 +114,7 @@ test_module_scan_all_with_scope (void)
|
||||
|
||||
ep = g_io_extension_point_register ("test-extension-point");
|
||||
scope = g_io_module_scope_new (G_IO_MODULE_SCOPE_BLOCK_DUPLICATES);
|
||||
g_io_module_scope_block (scope, "libtestmoduleb." G_MODULE_SUFFIX);
|
||||
g_io_module_scope_block (scope, MODULE_FILENAME_PREFIX "testmoduleb." G_MODULE_SUFFIX);
|
||||
g_io_modules_scan_all_in_directory_with_scope (g_test_get_filename (G_TEST_BUILT, "modules", NULL), scope);
|
||||
list = g_io_extension_point_get_extensions (ep);
|
||||
g_io_modules_scan_all_in_directory_with_scope (g_test_get_filename (G_TEST_BUILT, "modules/.libs", NULL), scope);
|
||||
|
@ -1,3 +1,14 @@
|
||||
/*
|
||||
* Ensure the g_io_module_*() symbols are exported
|
||||
* on all supported compilers without using config.h.
|
||||
* This must be done before including any GLib headers,
|
||||
* since GLIB_AVAILABLE_IN_ALL, which is used to mark the
|
||||
* g_io_module*() symbols, is defined to be _GLIB_EXTERN,
|
||||
* which must be overriden to export the symbols.
|
||||
*/
|
||||
#include "modules/symbol-visibility.h"
|
||||
#define _GLIB_EXTERN GLIB_TEST_EXPORT_SYMBOL
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
void
|
||||
|
@ -22,6 +22,12 @@
|
||||
#include "test_resources2.h"
|
||||
#include "digit_test_resources.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define MODULE_FILENAME_PREFIX ""
|
||||
#else
|
||||
# define MODULE_FILENAME_PREFIX "lib"
|
||||
#endif
|
||||
|
||||
static void
|
||||
test_resource (GResource *resource)
|
||||
{
|
||||
@ -641,7 +647,9 @@ test_resource_module (void)
|
||||
if (g_module_supported ())
|
||||
{
|
||||
/* For in-tree, this will find the .la file and use it to get to the .so in .libs/ */
|
||||
module = g_io_module_new (g_test_get_filename (G_TEST_BUILT, "libresourceplugin", NULL));
|
||||
module = g_io_module_new (g_test_get_filename (G_TEST_BUILT,
|
||||
MODULE_FILENAME_PREFIX "resourceplugin",
|
||||
NULL));
|
||||
|
||||
error = NULL;
|
||||
|
||||
|
@ -28,6 +28,12 @@
|
||||
#include <gmodule.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define MODULE_FILENAME_PREFIX ""
|
||||
#else
|
||||
# define MODULE_FILENAME_PREFIX "lib"
|
||||
#endif
|
||||
|
||||
gchar* global_state;
|
||||
|
||||
G_MODULE_EXPORT void g_clash_func (void);
|
||||
@ -84,8 +90,8 @@ main (int argc,
|
||||
if (!g_module_supported ())
|
||||
g_error ("dynamic modules not supported");
|
||||
|
||||
plugin_a = g_test_build_filename (G_TEST_BUILT, "libmoduletestplugin_a", NULL);
|
||||
plugin_b = g_test_build_filename (G_TEST_BUILT, "libmoduletestplugin_b", NULL);
|
||||
plugin_a = g_test_build_filename (G_TEST_BUILT, MODULE_FILENAME_PREFIX "moduletestplugin_a", NULL);
|
||||
plugin_b = g_test_build_filename (G_TEST_BUILT, MODULE_FILENAME_PREFIX "moduletestplugin_b", NULL);
|
||||
|
||||
/* module handles */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user