diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2005-10-09 07:16:50 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2005-10-09 07:16:50 +0000 |
commit | 90c12d3ec040cb6616ffbd224267692560de6fdd (patch) | |
tree | d59683b90c37c925afa205d9d7d3804e0a97151d | |
parent | 5f9009bb2afa30febe3725a89c66183c80149c5e (diff) | |
download | swig-90c12d3ec040cb6616ffbd224267692560de6fdd.tar.gz |
fix keyword problem with C#
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7631 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r-- | SWIG/Examples/test-suite/refcount.h | 28 | ||||
-rw-r--r-- | SWIG/Examples/test-suite/refcount.i | 4 |
2 files changed, 16 insertions, 16 deletions
diff --git a/SWIG/Examples/test-suite/refcount.h b/SWIG/Examples/test-suite/refcount.h index d98194bfa..897971bf7 100644 --- a/SWIG/Examples/test-suite/refcount.h +++ b/SWIG/Examples/test-suite/refcount.h @@ -1,5 +1,5 @@ -#ifndef __test_suite_refcount_h__ -#define __test_suite_refcount_h__ +#ifndef TEST_SUITE_REFCOUNT_H__ +#define TEST_SUITE_REFCOUNT_H__ struct RCObjBase { /*! @@ -17,7 +17,7 @@ struct RCObjBase { \return The reference counter value. */ - int ref() const + int addref() const { return add_ref(); } @@ -29,7 +29,7 @@ struct RCObjBase { \return The reference counter value, which can be zero after deletion. */ - int unref() const + int delref() const { if (ref_count() == 0 || del_ref() == 0 ) { @@ -75,9 +75,9 @@ protected: */ template <class T> inline -T* ref(T* r) +T* addref(T* r) { - return (r && r->ref() ) ? r : 0; + return (r && r->addref() ) ? r : 0; } /*! Unreference an RCObj object. @@ -85,9 +85,9 @@ T* ref(T* r) */ template <class T> inline -T* unref(T* r) +T* delref(T* r) { - return ( r && r->unref() ) ? r : 0; + return ( r && r->delref() ) ? r : 0; } @@ -163,7 +163,7 @@ inline RCPtr<T>::RCPtr(T* realPtr) : pointee(realPtr) { - ref(pointee); + addref(pointee); } template <class T> @@ -171,14 +171,14 @@ inline RCPtr<T>::RCPtr(const RCPtr& rhs) : pointee(rhs.pointee) { - ref(pointee); + addref(pointee); } template <class T> inline RCPtr<T>::~RCPtr() { - unref(pointee); + delref(pointee); } template <class T> @@ -186,13 +186,13 @@ inline RCPtr<T>& RCPtr<T>::operator=(const RCPtr& rhs) { if (pointee != rhs.pointee) { - unref(pointee); + delref(pointee); pointee = rhs.pointee; - ref(pointee); + addref(pointee); } return *this; } -#endif //__test_suite_refcount_h__ +#endif //TEST_SUITE_REFCOUNT_H__ diff --git a/SWIG/Examples/test-suite/refcount.i b/SWIG/Examples/test-suite/refcount.i index 9368f529e..33c27c20b 100644 --- a/SWIG/Examples/test-suite/refcount.i +++ b/SWIG/Examples/test-suite/refcount.i @@ -12,8 +12,8 @@ // ref. counting for RCObj and all its descendents at once // -%refobject RCObj "$this->ref();" -%unrefobject RCObj "$this->unref();" +%refobject RCObj "$this->addref();" +%unrefobject RCObj "$this->delref();" %include "refcount.h" |