shared_ptr improvements so the proxy class does not need to be specified - SWIG_SHARED_PTR macro deprecated and replaced by %shared_ptr
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12037 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
12cfc251e4
commit
3dfac02269
11 changed files with 117 additions and 75 deletions
|
|
@ -40,10 +40,23 @@ struct SWIG_null_deleter {
|
|||
}
|
||||
|
||||
|
||||
// Workaround empty first macro argument bug
|
||||
#define SWIGEMPTYHACK
|
||||
// Main user macro for defining shared_ptr typemaps for both const and non-const pointer types
|
||||
%define SWIG_SHARED_PTR(PROXYCLASS, TYPE...)
|
||||
%define %shared_ptr(TYPE...)
|
||||
%feature("smartptr", noblock=1) TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > }
|
||||
SWIG_SHARED_PTR_TYPEMAPS(PROXYCLASS, , TYPE)
|
||||
SWIG_SHARED_PTR_TYPEMAPS(PROXYCLASS, const, TYPE)
|
||||
SWIG_SHARED_PTR_TYPEMAPS(SWIGEMPTYHACK, TYPE)
|
||||
SWIG_SHARED_PTR_TYPEMAPS(const, TYPE)
|
||||
%enddef
|
||||
|
||||
// Legacy macros
|
||||
%define SWIG_SHARED_PTR(PROXYCLASS, TYPE...)
|
||||
#warning "SWIG_SHARED_PTR(PROXYCLASS, TYPE) is deprecated. Please use %shared_ptr(TYPE) instead."
|
||||
%shared_ptr(TYPE)
|
||||
%enddef
|
||||
|
||||
%define SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE...)
|
||||
#warning "SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %shared_ptr(TYPE) instead."
|
||||
%shared_ptr(TYPE)
|
||||
%enddef
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue