From 1998283f61e76928063dd46d7dfc0d2759d02855 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Wed, 1 Sep 2021 14:35:15 +1000 Subject: Ensure versionless wrappers do not introduce a new variable scope Using function instead of macro prevented the wrappers from being able to pass back any variables set by the wrapped function in the calling scope. Prefer macros to avoid future changes which might do this from silently swallowing such variable setting. Task-number: QTBUG-96121 Pick-to: 6.2 Change-Id: I293999c8054c2572e9145974a9ffac661f70bf35 Reviewed-by: Joerg Bornemann --- src/client/Qt6WaylandClientMacros.cmake | 4 ++-- src/compositor/Qt6WaylandCompositorMacros.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/Qt6WaylandClientMacros.cmake b/src/client/Qt6WaylandClientMacros.cmake index c81032595..f618f3ddc 100644 --- a/src/client/Qt6WaylandClientMacros.cmake +++ b/src/client/Qt6WaylandClientMacros.cmake @@ -82,7 +82,7 @@ function(qt6_generate_wayland_protocol_client_sources target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_generate_wayland_protocol_client_sources) + macro(qt_generate_wayland_protocol_client_sources) qt6_generate_wayland_protocol_client_sources(${ARGV}) - endfunction() + endmacro() endif() diff --git a/src/compositor/Qt6WaylandCompositorMacros.cmake b/src/compositor/Qt6WaylandCompositorMacros.cmake index 92ad04696..6953be7de 100644 --- a/src/compositor/Qt6WaylandCompositorMacros.cmake +++ b/src/compositor/Qt6WaylandCompositorMacros.cmake @@ -66,7 +66,7 @@ function(qt6_generate_wayland_protocol_server_sources target) endfunction() if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) - function(qt_generate_wayland_protocol_server_sources) + macro(qt_generate_wayland_protocol_server_sources) qt6_generate_wayland_protocol_server_sources(${ARGV}) - endfunction() + endmacro() endif() -- cgit v1.2.3