diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2022-09-09 07:49:48 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2022-09-09 19:36:08 +0100 |
commit | 0c2d0fea0fa882cc92ba40635ef09524deea4eea (patch) | |
tree | 4a2713488c47e438ddb5175ef2c4a9a395adfdd9 /Lib/swig.swg | |
parent | dcb2544a439d446cf8fd309bec252b0616181328 (diff) | |
download | swig-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/swig.swg')
-rw-r--r-- | Lib/swig.swg | 9 |
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 |