back to typemaps for size_t/ptrdiff_t. typedes don't work with std::vector
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6682 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6a01101fc8
commit
e49611443e
2 changed files with 15 additions and 6 deletions
|
|
@ -18,6 +18,8 @@ namespace std {
|
||||||
|
|
||||||
%template(DoubleVector) std::vector<double>;
|
%template(DoubleVector) std::vector<double>;
|
||||||
|
|
||||||
|
%template(SizeVector) std::vector<size_t>;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
typedef float Real;
|
typedef float Real;
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,21 @@
|
||||||
* --- ANSI/Posix C/C++ types ---
|
* --- ANSI/Posix C/C++ types ---
|
||||||
* ------------------------------------------------------------ */
|
* ------------------------------------------------------------ */
|
||||||
|
|
||||||
typedef unsigned long size_t;
|
%apply unsigned long { size_t };
|
||||||
typedef long ptrdiff_t;
|
%apply const unsigned long& { const size_t& };
|
||||||
|
%apply unsigned long& { size_t& };
|
||||||
|
|
||||||
|
%apply long { ptrdiff_t };
|
||||||
|
%apply const long& { const ptrdiff_t& };
|
||||||
|
%apply long& { ptrdiff_t& };
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
namespace std {
|
%apply unsigned long { std::size_t };
|
||||||
typedef unsigned long size_t;
|
%apply const unsigned long& { const std::size_t& };
|
||||||
typedef long ptrdiff_t;
|
%apply unsigned long& { std::size_t& };
|
||||||
}
|
|
||||||
|
|
||||||
|
%apply long { std::ptrdiff_t };
|
||||||
|
%apply const long& { const std::ptrdiff_t& };
|
||||||
|
%apply long& { std::ptrdiff_t& };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue