From 1f1f981be46fd9050699280665fcfac189f8fea2 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 Change-Id: I293999c8054c2572e9145974a9ffac661f70bf35 Reviewed-by: Joerg Bornemann (cherry picked from commit 1998283f61e76928063dd46d7dfc0d2759d02855) Reviewed-by: Qt Cherry-pick Bot --- 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 879841a07..0834e8809 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 a9e79ce45..0522f6582 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