Fix std::map warning keyword hack in Go
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12121 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7e7bd74ff2
commit
688db4ee29
3 changed files with 12 additions and 5 deletions
|
|
@ -1,6 +1,15 @@
|
||||||
%module("templatereduce") li_std_map
|
%module("templatereduce") li_std_map
|
||||||
%feature("trackobjects");
|
%feature("trackobjects");
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
namespace another {
|
||||||
|
struct map {
|
||||||
|
int val;
|
||||||
|
map(int x) : val(x) {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
%include "std_pair.i"
|
%include "std_pair.i"
|
||||||
%include "std_map.i"
|
%include "std_map.i"
|
||||||
%include "std_string.i"
|
%include "std_string.i"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
/* Rename keywords. */
|
/* Rename keywords. */
|
||||||
|
|
||||||
#define GOKW(x) %keywordwarn("'" `x` "' is a Go keyword, renaming to 'X"`x`"'",rename="X%s") `x`
|
#define GOKW(x) %keywordwarn("'" `x` "' is a Go keyword, renaming to 'X"`x`"'",rename="X%s") `x`
|
||||||
|
#define GOBN(x) %builtinwarn("'" `x` "' conflicts with a built-in name in Go") "::"`x`
|
||||||
|
|
||||||
GOKW(break);
|
GOKW(break);
|
||||||
GOKW(case);
|
GOKW(case);
|
||||||
|
|
@ -18,7 +19,6 @@ GOKW(goto);
|
||||||
GOKW(if);
|
GOKW(if);
|
||||||
GOKW(import);
|
GOKW(import);
|
||||||
GOKW(interface);
|
GOKW(interface);
|
||||||
GOKW(map);
|
|
||||||
GOKW(package);
|
GOKW(package);
|
||||||
GOKW(range);
|
GOKW(range);
|
||||||
GOKW(return);
|
GOKW(return);
|
||||||
|
|
@ -28,4 +28,6 @@ GOKW(switch);
|
||||||
GOKW(type);
|
GOKW(type);
|
||||||
GOKW(var);
|
GOKW(var);
|
||||||
|
|
||||||
|
GOBN(map);
|
||||||
|
|
||||||
#undef GOKW
|
#undef GOKW
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,7 @@
|
||||||
// std::map
|
// std::map
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
// "map" is a keyword in Go.
|
|
||||||
#define map cmap
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#define map cmap
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue