Merge branch 'master' into gsoc2009-matevz
Conflicts: Examples/Makefile.in Examples/guile/Makefile.in Lib/php/php.swg Makefile.in Source/CParse/parser.y configure.ac
This commit is contained in:
commit
bcb7aee022
585 changed files with 9528 additions and 12959 deletions
|
|
@ -195,42 +195,42 @@
|
|||
|
||||
%define %attribute(Class, AttributeType, AttributeName, GetMethod, SetMethod...)
|
||||
#if #SetMethod != ""
|
||||
%attribute_custom(Class, AttributeType, AttributeName, GetMethod, SetMethod, self_->GetMethod(), self_->SetMethod(val_))
|
||||
%attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, GetMethod, SetMethod, self_->GetMethod(), self_->SetMethod(val_))
|
||||
#else
|
||||
%attribute_readonly(Class, AttributeType, AttributeName, GetMethod, self_->GetMethod())
|
||||
%attribute_readonly(%arg(Class), %arg(AttributeType), AttributeName, GetMethod, self_->GetMethod())
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
%define %attribute2(Class, AttributeType, AttributeName, GetMethod, SetMethod...)
|
||||
#if #SetMethod != ""
|
||||
%attribute_custom(Class, AttributeType, AttributeName, GetMethod, SetMethod, &self_->GetMethod(), self_->SetMethod(*val_))
|
||||
%attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, GetMethod, SetMethod, &self_->GetMethod(), self_->SetMethod(*val_))
|
||||
#else
|
||||
%attribute_readonly(Class, AttributeType, AttributeName, GetMethod, &self_->GetMethod())
|
||||
%attribute_readonly(%arg(Class), %arg(AttributeType), AttributeName, GetMethod, &self_->GetMethod())
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
%define %attributeref(Class, AttributeType, AttributeName, AccessorMethod...)
|
||||
#if #AccessorMethod != ""
|
||||
%attribute_custom(Class, AttributeType, AttributeName, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_)
|
||||
%attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_)
|
||||
#else
|
||||
%attribute_custom(Class, AttributeType, AttributeName, AttributeName, AttributeName, self_->AttributeName(), self_->AttributeName() = val_)
|
||||
%attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, AttributeName, AttributeName, self_->AttributeName(), self_->AttributeName() = val_)
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
%define %attribute2ref(Class, AttributeType, AttributeName, AccessorMethod...)
|
||||
#if #AccessorMethod != ""
|
||||
%attribute_custom(Class, AttributeType, AttributeName, AccessorMethod, AccessorMethod, &self_->AccessorMethod(), self_->AccessorMethod() = *val_)
|
||||
%attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, AccessorMethod, AccessorMethod, &self_->AccessorMethod(), self_->AccessorMethod() = *val_)
|
||||
#else
|
||||
%attribute_custom(Class, AttributeType, AccessorName, AccessorName, AccessorName, &self_->AccessorName(), self_->AccessorName() = *val_)
|
||||
%attribute_custom(%arg(Class), %arg(AttributeType), AccessorName, AccessorName, AccessorName, &self_->AccessorName(), self_->AccessorName() = *val_)
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
// deprecated (same as %attributeref, but there is an argument order inconsistency)
|
||||
%define %attribute_ref(Class, AttributeType, AccessorMethod, AttributeName...)
|
||||
#if #AttributeName != ""
|
||||
%attribute_custom(Class, AttributeType, AttributeName, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_)
|
||||
%attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_)
|
||||
#else
|
||||
%attribute_custom(Class, AttributeType, AccessorMethod, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_)
|
||||
%attribute_custom(%arg(Class), %arg(AttributeType), AccessorMethod, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_)
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
|
|
|
|||
|
|
@ -153,6 +153,29 @@
|
|||
#include <stddef.h>
|
||||
%}
|
||||
|
||||
%fragment("SWIG_isfinite","header",fragment="<math.h>,<float.h>") %{
|
||||
/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
|
||||
#ifndef SWIG_isfinite
|
||||
# if defined(isfinite)
|
||||
# define SWIG_isfinite(X) (isfinite(X))
|
||||
# elif defined(_MSC_VER)
|
||||
# define SWIG_isfinite(X) (_finite(X))
|
||||
# elif defined(__sun) && defined(__SVR4)
|
||||
# include <ieeefp.h>
|
||||
# define SWIG_isfinite(X) (finite(X))
|
||||
# endif
|
||||
#endif
|
||||
%}
|
||||
|
||||
%fragment("SWIG_Float_Overflow_Check","header",fragment="<float.h>,SWIG_isfinite") %{
|
||||
/* Accept infinite as a valid float value unless we are unable to check if a value is finite */
|
||||
#ifdef SWIG_isfinite
|
||||
# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X))
|
||||
#else
|
||||
# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX))
|
||||
#endif
|
||||
%}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* special macros for fragments
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
|
@ -213,13 +236,20 @@ SWIG_AsVal_dec(Type)(SWIG_Object obj, Type *val)
|
|||
%enddef
|
||||
|
||||
|
||||
/* Macro for 'double' derived types */
|
||||
/* Macro for floating point derived types (original macro) */
|
||||
|
||||
%define %numeric_double(Type, Frag, Min, Max)
|
||||
%numeric_type_from(Type, double)
|
||||
%numeric_signed_type_asval(Type, double, Frag , Min, Max)
|
||||
%enddef
|
||||
|
||||
/* Macro for floating point derived types */
|
||||
|
||||
%define %numeric_float(Type, Frag, OverflowCond)
|
||||
%numeric_type_from(Type, double)
|
||||
%numeric_type_asval(Type, double, Frag, OverflowCond)
|
||||
%enddef
|
||||
|
||||
|
||||
/* Macros for missing fragments */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
The %implict macro allows a SwigType (Class) to be accepted
|
||||
The %implicit macro allows a SwigType (Class) to be accepted
|
||||
as an input parameter and use its implicit constructors when needed.
|
||||
|
||||
For example:
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ SWIG_AsVal_dec(bool)(SWIG_Object obj, bool *val)
|
|||
|
||||
/* float */
|
||||
|
||||
%numeric_double(float, "<float.h>", -FLT_MAX, FLT_MAX)
|
||||
%numeric_float(float, "SWIG_Float_Overflow_Check", SWIG_Float_Overflow_Check(v))
|
||||
|
||||
/* long/unsigned long */
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
--------------------------
|
||||
|
||||
%arg(Arg) Safe argument wrap
|
||||
%str(Arg) Stringtify the argument
|
||||
%begin_block Begin a execution block
|
||||
%end_block End a execution block
|
||||
%str(Arg) Stringtify the argument
|
||||
%begin_block Begin a execution block
|
||||
%end_block End a execution block
|
||||
%block(Block) Execute Block as a excecution block
|
||||
%define_as(Def, Val) Define 'Def' as 'Val', expanding Def and Val first
|
||||
%ifcplusplus(V1, V2) if C++ Mode; then V1; else V2; fi
|
||||
|
|
@ -19,33 +19,33 @@
|
|||
|
||||
Casting Operations:
|
||||
-------------------
|
||||
|
||||
|
||||
SWIG provides the following casting macros, which implement the
|
||||
corresponding C++ casting operations:
|
||||
|
||||
%const_cast(a, Type) const_cast<Type >(a)
|
||||
%static_cast(a, Type) static_cast<Type >(a)
|
||||
%reinterpret_cast(a, Type) reinterpret_cast<Type >(a)
|
||||
%numeric_cast(a, Type) static_cast<Type >(a)
|
||||
%as_voidptr(a) const_cast<void *>(static_cast<const void *>(a))
|
||||
%as_voidptrptr(a) reinterpret_cast<void **>(a)
|
||||
|
||||
%const_cast(a, Type) const_cast<Type >(a)
|
||||
%static_cast(a, Type) static_cast<Type >(a)
|
||||
%reinterpret_cast(a, Type) reinterpret_cast<Type >(a)
|
||||
%numeric_cast(a, Type) static_cast<Type >(a)
|
||||
%as_voidptr(a) const_cast<void *>(static_cast<const void *>(a))
|
||||
%as_voidptrptr(a) reinterpret_cast<void **>(a)
|
||||
|
||||
or their C unsafe versions. In C++ we use the safe version unless
|
||||
SWIG_NO_CPLUSPLUS_CAST is defined (usually via the -nocppcast swig flag).
|
||||
|
||||
|
||||
Memory allocation:
|
||||
------------------
|
||||
|
||||
|
||||
These allocation/freeing macros are safe to use in C or C++ and
|
||||
dispatch the proper new/delete/delete[] or free/malloc calls as
|
||||
needed.
|
||||
|
||||
|
||||
%new_instance(Type) Allocate a new instance of given Type
|
||||
%new_copy(value,Type) Allocate and initialize a new instance with 'value'
|
||||
%new_array(size,Type) Allocate a new array with given size and Type
|
||||
%new_copy_array(cptr,size,Type) Allocate and initialize a new array from 'cptr'
|
||||
%delete(cptr) Delete an instance
|
||||
%delete(cptr) Delete an instance
|
||||
%delete_array(cptr) Delete an array
|
||||
|
||||
|
||||
|
|
@ -54,13 +54,13 @@
|
|||
|
||||
%formacro(Macro, Args...) or %formacro_1(Macro, Args...)
|
||||
for i in Args
|
||||
do
|
||||
do
|
||||
Macro($i)
|
||||
done
|
||||
|
||||
%formacro_2(Macro2, Args...)
|
||||
for i,j in Args
|
||||
do
|
||||
do
|
||||
Macro2($i, $j)
|
||||
done
|
||||
|
||||
|
|
@ -71,12 +71,12 @@
|
|||
%mark_flag(flag)
|
||||
flag := True
|
||||
|
||||
%evalif(flag,expr)
|
||||
%evalif(flag,expr)
|
||||
if flag; then
|
||||
expr
|
||||
fi
|
||||
|
||||
%evalif_2(flag1 flag2,expr)
|
||||
%evalif_2(flag1 flag2,expr)
|
||||
if flag1 and flag2; then
|
||||
expr
|
||||
fi
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
|
||||
*/
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Basic preprocessor macros
|
||||
* Basic preprocessor macros
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#define %arg(Arg...) Arg
|
||||
|
|
@ -115,7 +115,7 @@ nocppval
|
|||
%define_as(SWIGVERSION, SWIG_VERSION)
|
||||
%#define SWIG_VERSION SWIGVERSION
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
@ -153,10 +153,10 @@ nocppval
|
|||
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Allocating/freeing elements
|
||||
* Allocating/freeing elements
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#if defined(__cplusplus)
|
||||
# define %new_instance(Type...) (new Type)
|
||||
# define %new_copy(val,Type...) (new Type(%static_cast(val, const Type&)))
|
||||
# define %new_array(size,Type...) (new Type[size])
|
||||
|
|
@ -184,7 +184,7 @@ nocppval
|
|||
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Auxiliary loop macros
|
||||
* Auxiliary loop macros
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
|
|
@ -213,10 +213,10 @@ nocppval
|
|||
* SWIG flags
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
/*
|
||||
mark a flag, ie, define a macro name but ignore it in
|
||||
the interface.
|
||||
|
||||
the interface.
|
||||
|
||||
the flag can be later used with %evalif
|
||||
*/
|
||||
|
||||
|
|
@ -224,16 +224,16 @@ nocppval
|
|||
|
||||
|
||||
/*
|
||||
%evalif and %evalif_2 are use to evaluate or process
|
||||
%evalif and %evalif_2 are use to evaluate or process
|
||||
an expression if the given predicate is 'true' (1).
|
||||
*/
|
||||
%define %_evalif(_x,_expr)
|
||||
%define %_evalif(_x,_expr)
|
||||
#if _x == 1
|
||||
_expr
|
||||
#endif
|
||||
%enddef
|
||||
|
||||
%define %_evalif_2(_x,_y,_expr)
|
||||
%define %_evalif_2(_x,_y,_expr)
|
||||
#if _x == 1 && _y == 1
|
||||
_expr
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue