Merged r4717:4718 from branches/SDL-1.2: minor OS/2 DECLSPEC/SDLCALL fixes.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 06 Jan 2010 20:58:03 +0000
changeset 3618276a6474a449
parent 3617 023aa9699baa
child 3619 07fbaf6ccb51
Merged r4717:4718 from branches/SDL-1.2: minor OS/2 DECLSPEC/SDLCALL fixes.

I reworked this a little. The 1.2 branch isn't really very elegant about this.
include/begin_code.h
     1.1 --- a/include/begin_code.h	Wed Jan 06 20:31:21 2010 +0000
     1.2 +++ b/include/begin_code.h	Wed Jan 06 20:58:03 2010 +0000
     1.3 @@ -52,6 +52,12 @@
     1.4  #  else
     1.5  #   define DECLSPEC	__declspec(dllexport)
     1.6  #  endif
     1.7 +# elif defined(__OS2__)
     1.8 +#   ifdef BUILD_SDL
     1.9 +#    define DECLSPEC    __declspec(dllexport)
    1.10 +#   else
    1.11 +#    define DECLSPEC
    1.12 +#   endif
    1.13  # else
    1.14  #  if defined(__GNUC__) && __GNUC__ >= 4
    1.15  #   define DECLSPEC	__attribute__ ((visibility("default")))
    1.16 @@ -63,11 +69,18 @@
    1.17  
    1.18  /* By default SDL uses the C calling convention */
    1.19  #ifndef SDLCALL
    1.20 -#if defined(__WIN32__) && !defined(__GNUC__)
    1.21 -#define SDLCALL __cdecl
    1.22 -#else
    1.23 -#define SDLCALL
    1.24 -#endif
    1.25 +# if defined(__WIN32__) && !defined(__GNUC__)
    1.26 +#  define SDLCALL __cdecl
    1.27 +# elif defined(__OS2__)
    1.28 +   /* Use the _System calling convention to be compatible with every OS/2
    1.29 +      compiler. (Please note that this used to be _cdecl for GCC, but that
    1.30 +      was a bug. Someone should go examine and fix the XFree86 integration
    1.31 +      instead. We shouldn't be passing SDLCALL function pointers between SDL
    1.32 +      and XFree86!) */
    1.33 +#  define SDLCALL _System
    1.34 +# else
    1.35 +#  define SDLCALL
    1.36 +# endif
    1.37  #endif /* SDLCALL */
    1.38  
    1.39  /* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */