new test to test windows calling conventions with extern functions

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7320 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-06-27 21:15:55 +00:00
commit c838d83d2c
3 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,27 @@
%module extern_declaration
// Test different calling conventions on Windows. Old versions of SWIG generated
// an incorrect extern declarations that wouldn't compile with Windows compilers.
#define SWIGEXPORT
#define SWIGSTDCALL
#define DLLIMPORT
%{
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define DLLIMPORT __declspec(dllimport)
#else
# define DLLIMPORT
#endif
%}
DLLIMPORT extern int externimport(int in);
SWIGEXPORT extern int externexport(int);
extern int SWIGSTDCALL externstdcall(int);
%{
SWIGEXPORT extern int externimport(int in) { return in; }
SWIGEXPORT extern int externexport(int in) { return in; }
extern int SWIGSTDCALL externstdcall(int in) { return in; }
%}