summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2022-09-09 07:49:48 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2022-09-09 19:36:08 +0100
commit0c2d0fea0fa882cc92ba40635ef09524deea4eea (patch)
tree4a2713488c47e438ddb5175ef2c4a9a395adfdd9 /Lib
parentdcb2544a439d446cf8fd309bec252b0616181328 (diff)
downloadswig-0c2d0fea0fa882cc92ba40635ef09524deea4eea.tar.gz
Move SwigValueWrapper to header section
Recent change to SwigValueWrapper required the <utility> header. Included headers should be after the include of the language specific header files (which go into the earlier runtime section). Testcase required -Winit-list-lifetime warning suppression change for Perl which somehow lost the warning suppression when put into the %begin section.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/swig.swg9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/swig.swg b/Lib/swig.swg
index 9148c9153..6cac0e377 100644
--- a/Lib/swig.swg
+++ b/Lib/swig.swg
@@ -665,7 +665,9 @@ namespace std {
*/
#ifdef __cplusplus
-%insert("runtime") %{
+// Placed in the header section to ensure the language specific header files are
+// the first included headers and not <utility>
+%insert("header") %{
#ifdef __cplusplus
#include <utility>
/* SwigValueWrapper is described in swig.swg */
@@ -688,7 +690,7 @@ public:
operator T&() const { return *pointer.ptr; }
#endif
T *operator&() const { return pointer.ptr; }
-};%}
+};
/*
* SwigValueInit() is a generic initialisation solution as the following approach:
@@ -699,13 +701,10 @@ public:
*
* unsigned int c_result = unsigned int();
*/
-%insert("runtime") %{
template <typename T> T SwigValueInit() {
return T();
}
-%}
-%insert("runtime") %{
#if __cplusplus >=201103L
# define SWIG_STD_MOVE(OBJ) std::move(OBJ)
#else