Uniform SWIGEXPORT handling, reverting back to SWIG-1.3.24 approach, plus changes which remove unnecessary Borland specific handling.

SWIGSTDCALL available for all languages and can be overidden by users.
General tidy up.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7231 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-05-27 22:35:41 +00:00
commit d6d5cc11e9

View file

@ -5,18 +5,7 @@
* *
************************************************************************/ ************************************************************************/
/* /* template workaround for compilers that cannot correctly implement the C++ standard */
SWIGTEMPLATEDISAMBIGUATOR is needed when wrapping template calls
(cwrap.c:Swig_cfunction_call/Swig_cmethod_call), as in
result = nspace::template function<int >(arg1);
result = arg1->template method<int >(arg2);
SWIGTEMPLATEDISAMBIGUATOR is compiler dependent (common.swg),
- SUN Studio requires 'template',
- gcc-3.4 forbids the use of 'template'.
- gcc-3.2.3 produces internal errors if you use 'template'
*/
#ifndef SWIGTEMPLATEDISAMBIGUATOR #ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) # if defined(__SUNPRO_CC)
# define SWIGTEMPLATEDISAMBIGUATOR template # define SWIGTEMPLATEDISAMBIGUATOR template
@ -34,7 +23,7 @@
# endif # endif
#endif #endif
/* attritbute passed for some compilers to avoid 'unused' warnings */ /* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED #ifndef SWIGUNUSED
# if defined(__GNUC__) || defined(__ICC) # if defined(__GNUC__) || defined(__ICC)
# define SWIGUNUSED __attribute__ ((unused)) # define SWIGUNUSED __attribute__ ((unused))
@ -53,23 +42,25 @@
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif #endif
/* how we export a method such that it can go in to a shared or dll library */ /* exporting methods for Windows DLLs */
#ifndef SWIGEXPORT #ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(_MSC_VER) || defined(__GNUC__)
# if defined(STATIC_LINKED) # if defined(STATIC_LINKED)
# define SWIGEXPORT(a) a # define SWIGEXPORT
# else # else
# define SWIGEXPORT(a) __declspec(dllexport) a # define SWIGEXPORT __declspec(dllexport)
# endif # endif
# else # else
# if defined(__BORLANDC__) # define SWIGEXPORT
# define SWIGEXPORT(a) a _export # endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else # else
# define SWIGEXPORT(a) a # define SWIGSTDCALL
# endif
# endif
# else
# define SWIGEXPORT(a) a
# endif # endif
#endif #endif