From fce681d3617b2e410d05404a057de57f71c77783 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 20 Oct 2021 11:03:00 +0800 Subject: clutter-event-win32.c: Fix build Fix a typo. --- clutter/win32/clutter-event-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clutter/win32/clutter-event-win32.c b/clutter/win32/clutter-event-win32.c index 391cadc58..6cd42662f 100644 --- a/clutter/win32/clutter-event-win32.c +++ b/clutter/win32/clutter-event-win32.c @@ -493,7 +493,7 @@ clutter_win32_handle_event (const MSG *msg) break; case WM_MBUTTONDBLCLK: - make_button_event (msg, stage, CLUTER_BUTTON_MIDDLE, 2, FALSE, core_pointer); + make_button_event (msg, stage, CLUTTER_BUTTON_MIDDLE , 2, FALSE, core_pointer); break; case WM_RBUTTONDBLCLK: -- cgit v1.2.1 From b377845cf3bb07c9296db779311db978876d0b4b Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 20 Oct 2021 11:03:45 +0800 Subject: examples: Define _USE_MATH_DEFINES as needed For builds using the Visual Studio headers, we must define _USE_MATH_DEFINES in order for _M_PI to work. --- examples/meson.build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/meson.build b/examples/meson.build index 532e9bb21..256168945 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -32,10 +32,17 @@ if enable_pixbuf_tests ] endif +examples_cargs = [] + +if cc.get_argument_syntax() == 'msvc' + examples_cargs += '-D_USE_MATH_DEFINES' +endif + foreach e: examples executable( e, e + '.c', dependencies: examples_deps, + c_args: examples_cargs, ) endforeach -- cgit v1.2.1 From beed3a05f77654cde82ab1d9cfef335c702525d8 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 20 Oct 2021 14:55:18 +0800 Subject: clutter/meson.build: Fill in win32 config We forgot to put into clutter-config.h the Windows items, which means that we would actually build the Win32 parts in vain. --- clutter/meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clutter/meson.build b/clutter/meson.build index 68cd5f1a6..0c34638a9 100644 --- a/clutter/meson.build +++ b/clutter/meson.build @@ -365,6 +365,12 @@ if enabled_backends.contains('mir') '#define CLUTTER_INPUT_MIR "mir"', ] endif +if enabled_backends.contains('win32') + clutter_config += [ + '#define CLUTTER_WINDOWING_WIN32 "win32"', + '#define CLUTTER_INPUT_WIN32 "win32"', + ] +endif clutter_config += '#define CLUTTER_INPUT_NULL "null"' clutter_config_h = configuration_data() -- cgit v1.2.1 From ff463f8692eb33c5b8a1287e120ea2a966241731 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 20 Oct 2021 14:56:36 +0800 Subject: tests/conform: Don't set x11 backend unconditionally We may not be running the tests on an X11-based system --- tests/conform/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/conform/meson.build b/tests/conform/meson.build index a8da1b398..25c03c794 100644 --- a/tests/conform/meson.build +++ b/tests/conform/meson.build @@ -6,11 +6,14 @@ test_cflags = [ test_env = [ 'G_ENABLE_DIAGNOSTIC=0', 'CLUTTER_ENABLE_DIAGNOSTIC=0', - 'CLUTTER_BACKEND=x11', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), ] +if enabled_backends.contains('x11') + test_env += 'CLUTTER_BACKEND=x11' +endif + actor_tests = [ 'actor-anchors', 'actor-destroy', -- cgit v1.2.1 From f98278c0b8658a53eafbadf1b7a9eacd266aee0c Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 20 Oct 2021 15:27:16 +0800 Subject: meson.build: Force-include msvc_recommended_pragmas.h ...on Visual Studio builds. We can get rid of lots of compiler noise with that header, which we are free to use since we are always using GLib. Also, define _GNU_SOURCE when we are not using Visual Studio. --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e4051877a..4cb771aaa 100644 --- a/meson.build +++ b/meson.build @@ -28,7 +28,13 @@ clutter_libversion = '@0@.@1@.@2@'.format(clutter_so_age, clutter_binary_age, cl cc = meson.get_compiler('c') config_h = configuration_data() -add_project_arguments([ '-D_GNU_SOURCE', '-DHAVE_CONFIG_H' ], language: 'c') +add_project_arguments(['-DHAVE_CONFIG_H' ], language: 'c') + +if cc.get_id() == 'msvc' + add_project_arguments([ '-FImsvc_recommended_pragmas.h' ], language: 'c') +else + add_project_arguments([ '-D_GNU_SOURCE' ], language: 'c') +endif # Paths clutter_prefix = get_option('prefix') -- cgit v1.2.1 From 1f87d51414bde2a7a7951af60caff1557c0862ee Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 20 Oct 2021 15:28:59 +0800 Subject: clutter-stage.c: Avoid returning value in a void function Eliminate warning C4098 (returning value in a void function), which is considered an error if building against GLib-2.68.x or later. --- clutter/clutter-stage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 2c67ca3ad..d28167274 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -3795,8 +3795,8 @@ _clutter_stage_schedule_update (ClutterStage *stage) if (stage_window == NULL) return; - return _clutter_stage_window_schedule_update (stage_window, - stage->priv->sync_delay); + _clutter_stage_window_schedule_update (stage_window, + stage->priv->sync_delay); } /* Returns the earliest time the stage is ready to update */ -- cgit v1.2.1