summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-09-01 14:35:15 +1000
committerCraig Scott <craig.scott@qt.io>2021-09-01 17:42:08 +1000
commit1998283f61e76928063dd46d7dfc0d2759d02855 (patch)
tree00c863db4f7c3b521cde938405d246d02893f630
parent532fb0237e4330ab52d6138a5979b20cc39753b6 (diff)
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 <joerg.bornemann@qt.io>
-rw-r--r--src/client/Qt6WaylandClientMacros.cmake4
-rw-r--r--src/compositor/Qt6WaylandCompositorMacros.cmake4
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()