summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-09-01 14:19:37 +1000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-01 07:44:35 +0000
commitb3d8a565b751d37d60160ce133e554141579905a (patch)
treeec5e9653d7c60df410334318b9ea395bb7c8ad0d /src
parent69f47ea557917aa9fd4d6b3c770f0c867b70d018 (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 in the wrapped function. In some cases, these variables were being explicitly passed back to the caller, but that isn't needed if you just make each wrapper a macro. This also makes things more future-proof because any newly introduced output variables will work without having to update the wrappers. Task-number: QTBUG-96121 Change-Id: I475a9680e038363b22cacde12c138e904a878f68 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 0d995353419ec4908a322ebae7b5797b8c758688) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/scxml/Qt6ScxmlMacros.cmake9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/scxml/Qt6ScxmlMacros.cmake b/src/scxml/Qt6ScxmlMacros.cmake
index f78155c..b4a5a5f 100644
--- a/src/scxml/Qt6ScxmlMacros.cmake
+++ b/src/scxml/Qt6ScxmlMacros.cmake
@@ -97,12 +97,11 @@ function(qt6_add_statecharts target_or_outfiles)
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
- function(qt_add_statecharts outfiles)
+ macro(qt_add_statecharts)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
- qt5_add_statecharts("${outfiles}" ${ARGN})
+ qt5_add_statecharts(${ARGV})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
- qt6_add_statecharts("${outfiles}" ${ARGN})
+ qt6_add_statecharts(${ARGV})
endif()
- set("${outfiles}" "${${outfiles}}" PARENT_SCOPE)
- endfunction()
+ endmacro()
endif()