From f9e85bb27f251f3e1e265ad52ed9eac3c203eebb Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 16 Apr 2012 18:45:33 +0000 Subject: [PATCH] Some test-suite fixes for visual studio git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12996 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/director_binary_string.i | 4 ++-- Examples/test-suite/operator_pointer_ref.i | 6 ++++++ Examples/test-suite/refcount.i | 2 +- Examples/test-suite/special_variable_macros.i | 6 ++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Examples/test-suite/director_binary_string.i b/Examples/test-suite/director_binary_string.i index ec64bc4b4..96c835959 100644 --- a/Examples/test-suite/director_binary_string.i +++ b/Examples/test-suite/director_binary_string.i @@ -29,12 +29,12 @@ public: void delCallback() { delete _callback; _callback = 0; } void setCallback(Callback *cb) { delCallback(); _callback = cb; } int call() { + int sum = 0; if (_callback) { char* aa = (char*)malloc(BUFFER_SIZE_AA); memset(aa, 9, BUFFER_SIZE_AA); char* bb = (char*)malloc(BUFFER_SIZE_BB); memset(bb, 13, BUFFER_SIZE_BB); - int sum = 0; _callback->run(aa, BUFFER_SIZE_AA, bb, BUFFER_SIZE_BB); for (int i = 0; i < BUFFER_SIZE_AA; i++) sum += aa[i]; @@ -42,8 +42,8 @@ public: sum += bb[i]; free(aa); free(bb); - return sum; } + return sum; } }; diff --git a/Examples/test-suite/operator_pointer_ref.i b/Examples/test-suite/operator_pointer_ref.i index 1541adbcf..84182da0d 100644 --- a/Examples/test-suite/operator_pointer_ref.i +++ b/Examples/test-suite/operator_pointer_ref.i @@ -1,5 +1,11 @@ %module operator_pointer_ref +%{ +#if defined(_MSC_VER) + #pragma warning(disable: 4996) // 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details. +#endif +%} + %rename(AsCharStarRef) operator char*&; %inline %{ diff --git a/Examples/test-suite/refcount.i b/Examples/test-suite/refcount.i index 28b55545b..d47323482 100644 --- a/Examples/test-suite/refcount.i +++ b/Examples/test-suite/refcount.i @@ -97,7 +97,7 @@ RCPtr _a; }; -class B* global_create(A* a) +struct B* global_create(A* a) { return new B(a); } diff --git a/Examples/test-suite/special_variable_macros.i b/Examples/test-suite/special_variable_macros.i index ba9889d7a..65f5496eb 100644 --- a/Examples/test-suite/special_variable_macros.i +++ b/Examples/test-suite/special_variable_macros.i @@ -5,6 +5,12 @@ %warnfilter(SWIGWARN_GO_NAME_CONFLICT); /* Ignoring 'NewName' due to Go name ('NewName') conflict with 'Name' */ +%{ +#if defined(_MSC_VER) + #pragma warning(disable: 4996) // 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strdup. See online help for details. +#endif +%} + %ignore Name::operator=; %inline %{