better STL support, see CHANGES.current
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5755 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9d65aeb47d
commit
328098bbb2
25 changed files with 3572 additions and 4193 deletions
93
SWIG/Lib/python/pymacros.swg
Normal file
93
SWIG/Lib/python/pymacros.swg
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
%{
|
||||
/* Auxiliar swig macros that appear in the header */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define SWIGSTATICINLINE(a) static inline a
|
||||
#define SWIGSTATIC(a) static a
|
||||
#define swig_new_array(size,Type) (new Type[(size)])
|
||||
#define swig_delete_array(cptr) delete[] cptr
|
||||
#define swig_const_cast(a,Type) const_cast<Type >(a)
|
||||
#define swig_static_cast(a,Type) static_cast<Type >(a)
|
||||
#define swig_reinterpret_cast(a,Type) reinterpret_cast<Type >(a)
|
||||
#define swig_new_copy(ptr,Type) (new Type(*ptr))
|
||||
#define swig_numeric_cast(a,Type) static_cast<Type >(a)
|
||||
|
||||
#else /* C case */
|
||||
|
||||
#define SWIGSTATICINLINE(a) static a
|
||||
#define SWIGSTATIC(a) static a
|
||||
#define swig_new_array(size,Type) ((Type*) malloc((size)*sizeof(Type)))
|
||||
#define swig_delete_array(cptr) free((char*)cptr)
|
||||
#define swig_const_cast(a,Type) (Type)(a)
|
||||
#define swig_static_cast(a,Type) (Type)(a)
|
||||
#define swig_reinterpret_cast(a,Type) (Type)(a)
|
||||
#define swig_numeric_cast(a,Type) (Type)(a)
|
||||
#define swig_new_copy(ptr,Type) ((Type*)memcpy(malloc(sizeof(Type)),ptr,sizeof(Type)))
|
||||
|
||||
#endif /* __cplusplus */
|
||||
%}
|
||||
|
||||
|
||||
/* Auxiliar swig macros used to write typemaps */
|
||||
#define SWIG_arg(...) __VA_ARGS__
|
||||
#define SWIG_str(...) #__VA_ARGS__
|
||||
|
||||
#define SWIG_Mangle(...) #@__VA_ARGS__
|
||||
|
||||
#define SWIG_MethodType(Name, ...) SWIG_ ## Name ## _ ## #@__VA_ARGS__
|
||||
#define SWIG_StringType(Name, ...) "SWIG_" #Name "_" {__VA_ARGS__}
|
||||
|
||||
#define SWIG_AsVal_meth(...) SWIG_MethodType(AsVal, __VA_ARGS__)
|
||||
#define SWIG_AsPtr_meth(...) SWIG_MethodType(AsPtr, __VA_ARGS__)
|
||||
#define SWIG_As_meth(...) SWIG_MethodType(As, __VA_ARGS__)
|
||||
#define SWIG_From_meth(...) SWIG_MethodType(From, __VA_ARGS__)
|
||||
#define SWIG_Check_meth(...) SWIG_MethodType(Check, __VA_ARGS__)
|
||||
#define SWIG_CCode(...) SWIG_MethodType(TYPECHECK, __VA_ARGS__)
|
||||
#define SWIG_Order(...) SWIG_MethodType(Order, __VA_ARGS__)
|
||||
|
||||
#define SWIG_Traits_frag(...) SWIG_StringType(Traits, __VA_ARGS__)
|
||||
#define SWIG_AsPtr_frag(...) SWIG_StringType(AsPtr, __VA_ARGS__)
|
||||
#define SWIG_AsVal_frag(...) SWIG_StringType(AsVal, __VA_ARGS__)
|
||||
#define SWIG_As_frag(...) SWIG_StringType(As, __VA_ARGS__)
|
||||
#define SWIG_From_frag(...) SWIG_StringType(From, __VA_ARGS__)
|
||||
#define SWIG_Check_frag(...) SWIG_StringType(Check, __VA_ARGS__)
|
||||
#define SWIG_CCode_frag(...) SWIG_StringType(TYPECHECK, __VA_ARGS__)
|
||||
|
||||
|
||||
%define SWIG_define(Def, Val)
|
||||
%#define Def Val
|
||||
%enddef
|
||||
|
||||
%define SWIG_cplusplus(cppval, cval)
|
||||
#if __cplusplus
|
||||
cppval
|
||||
#else
|
||||
cval
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
/* for loop for macro with one argument */
|
||||
|
||||
%define %_formacro_1(macro, arg1,...)
|
||||
macro(arg1)
|
||||
#if #__VA_ARGS__ != "__fordone__"
|
||||
%_formacro_1(macro, __VA_ARGS__)
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
%define %formacro_1(macro,...)
|
||||
%_formacro_1(macro,__VA_ARGS__,__fordone__)
|
||||
%enddef
|
||||
|
||||
/* for loop for macro with two arguments */
|
||||
|
||||
%define %_formacro_2(macro, arg1, arg2, ...)
|
||||
macro(arg1, arg2)
|
||||
#if #__VA_ARGS__ != "__fordone__"
|
||||
%_formacro_2(macro, __VA_ARGS__)
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
%define %formacro_2(macro,...)
|
||||
%_formacro_2(macro, __VA_ARGS__, __fordone__)
|
||||
%enddef
|
||||
Loading…
Add table
Add a link
Reference in a new issue