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:
William S Fulton 2010-06-11 22:36:58 +00:00
commit 688db4ee29
3 changed files with 12 additions and 5 deletions

View file

@ -1,6 +1,15 @@
%module("templatereduce") li_std_map
%feature("trackobjects");
%inline %{
namespace another {
struct map {
int val;
map(int x) : val(x) {}
};
}
%}
%include "std_pair.i"
%include "std_map.i"
%include "std_string.i"

View file

@ -1,6 +1,7 @@
/* Rename keywords. */
#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(case);
@ -18,7 +19,6 @@ GOKW(goto);
GOKW(if);
GOKW(import);
GOKW(interface);
GOKW(map);
GOKW(package);
GOKW(range);
GOKW(return);
@ -28,4 +28,6 @@ GOKW(switch);
GOKW(type);
GOKW(var);
GOBN(map);
#undef GOKW

View file

@ -10,11 +10,7 @@
// std::map
// ------------------------------------------------------------------------
// "map" is a keyword in Go.
#define map cmap
%{
#define map cmap
#include <map>
#include <algorithm>
#include <stdexcept>