[gtk+] testsuite: Fix builder test on Windows/MSVC
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] testsuite: Fix builder test on Windows/MSVC
- Date: Fri, 15 Sep 2017 13:41:40 +0000 (UTC)
commit 60297b9fc7d783f13e46bc8dfa6605a9be619f54
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Aug 1 16:57:11 2017 +0800
testsuite: Fix builder test on Windows/MSVC
Visual Studio does not support things like -Wl,export-dynamic, so we
need to export those symbols by using __declspec(dllexport). So, we
decorate these with macros which we define accordingly for this purpose.
https://bugzilla.gnome.org/show_bug.cgi?id=785210
testsuite/gtk/builder.c | 28 +++++++++++++++++-----------
testsuite/gtk/meson.build | 8 +++++++-
2 files changed, 24 insertions(+), 12 deletions(-)
---
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index cd48b37..372bb15 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -25,15 +25,21 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+#ifdef G_OS_WIN32
+# define _BUILDER_TEST_EXPORT __declspec(dllexport)
+#else
+# define _BUILDER_TEST_EXPORT
+#endif
+
/* exported for GtkBuilder */
-void signal_normal (GtkWindow *window, GParamSpec *spec);
-void signal_after (GtkWindow *window, GParamSpec *spec);
-void signal_object (GtkButton *button, GParamSpec *spec);
-void signal_object_after (GtkButton *button, GParamSpec *spec);
-void signal_first (GtkButton *button, GParamSpec *spec);
-void signal_second (GtkButton *button, GParamSpec *spec);
-void signal_extra (GtkButton *button, GParamSpec *spec);
-void signal_extra2 (GtkButton *button, GParamSpec *spec);
+_BUILDER_TEST_EXPORT void signal_normal (GtkWindow *window, GParamSpec *spec);
+_BUILDER_TEST_EXPORT void signal_after (GtkWindow *window, GParamSpec *spec);
+_BUILDER_TEST_EXPORT void signal_object (GtkButton *button, GParamSpec *spec);
+_BUILDER_TEST_EXPORT void signal_object_after (GtkButton *button, GParamSpec *spec);
+_BUILDER_TEST_EXPORT void signal_first (GtkButton *button, GParamSpec *spec);
+_BUILDER_TEST_EXPORT void signal_second (GtkButton *button, GParamSpec *spec);
+_BUILDER_TEST_EXPORT void signal_extra (GtkButton *button, GParamSpec *spec);
+_BUILDER_TEST_EXPORT void signal_extra2 (GtkButton *button, GParamSpec *spec);
static GtkBuilder *
@@ -2335,13 +2341,13 @@ test_level_bar (void)
static GObject *external_object = NULL, *external_object_swapped = NULL;
-void
+_BUILDER_TEST_EXPORT void
on_button_clicked (GtkButton *button, GObject *data)
{
external_object = data;
}
-void
+_BUILDER_TEST_EXPORT void
on_button_clicked_swapped (GObject *data, GtkButton *button)
{
external_object_swapped = data;
@@ -2559,7 +2565,7 @@ test_template ()
g_assert (GTK_IS_LABEL (my_gtk_grid->priv->label));
}
-void
+_BUILDER_TEST_EXPORT void
on_cellrenderertoggle1_toggled (GtkCellRendererToggle *cell)
{
}
diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build
index 5623613..5c6e885 100644
--- a/testsuite/gtk/meson.build
+++ b/testsuite/gtk/meson.build
@@ -1,9 +1,15 @@
+gtk_tests_export_dynamic_ldflag = []
+
+if cc.get_id() != 'msvc'
+ gtk_tests_export_dynamic_ldflag = ['-Wl,--export-dynamic']
+endif
+
tests = [
['accel'],
['accessible'],
['adjustment'],
['bitmask', ['../../gtk/gtkallocatedbitmask.c'], ['-DGTK_COMPILATION', '-UG_ENABLE_DEBUG']],
- ['builder', [], [], ['-Wl,--export-dynamic']],
+ ['builder', [], [], gtk_tests_export_dynamic_ldflag],
['builderparser'],
['cellarea'],
['check-icon-names'],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]