Fixed bug 3752 - minor os2 defines
authorSam Lantinga <slouken@libsdl.org>
Mon, 14 Aug 2017 10:15:38 -0700
changeset 112874d2a6202caa4
parent 11286 61b90db596ee
child 11288 47a5a4999180
Fixed bug 3752 - minor os2 defines

Ozkan Sezer

Attached three patches, so these minor os/2 bits get registered mainstream:

1. SDL_syswm.h: add SDL_SYSWM_OS2 to SDL_SYSWM_TYPE enum
2. SDL_platform.h: recognize __EMX__ too as __OS2__
3. begin_code.h: set SDLCALL as _System for OS/2.
include/SDL_platform.h
include/SDL_syswm.h
include/begin_code.h
     1.1 --- a/include/SDL_platform.h	Mon Aug 14 10:14:07 2017 -0700
     1.2 +++ b/include/SDL_platform.h	Mon Aug 14 10:15:38 2017 -0700
     1.3 @@ -97,7 +97,7 @@
     1.4  #undef __OPENBSD__
     1.5  #define __OPENBSD__ 1
     1.6  #endif
     1.7 -#if defined(__OS2__)
     1.8 +#if defined(__OS2__) || defined(__EMX__)
     1.9  #undef __OS2__
    1.10  #define __OS2__     1
    1.11  #endif
     2.1 --- a/include/SDL_syswm.h	Mon Aug 14 10:14:07 2017 -0700
     2.2 +++ b/include/SDL_syswm.h	Mon Aug 14 10:15:38 2017 -0700
     2.3 @@ -125,7 +125,8 @@
     2.4      SDL_SYSWM_MIR,
     2.5      SDL_SYSWM_WINRT,
     2.6      SDL_SYSWM_ANDROID,
     2.7 -    SDL_SYSWM_VIVANTE
     2.8 +    SDL_SYSWM_VIVANTE,
     2.9 +    SDL_SYSWM_OS2
    2.10  } SDL_SYSWM_TYPE;
    2.11  
    2.12  /**
     3.1 --- a/include/begin_code.h	Mon Aug 14 10:14:07 2017 -0700
     3.2 +++ b/include/begin_code.h	Mon Aug 14 10:15:38 2017 -0700
     3.3 @@ -61,6 +61,12 @@
     3.4  #  else
     3.5  #   define DECLSPEC __declspec(dllexport)
     3.6  #  endif
     3.7 +# elif defined(__OS2__) && defined(__WATCOMC__)
     3.8 +#   ifdef BUILD_SDL
     3.9 +#    define DECLSPEC    __declspec(dllexport)
    3.10 +#   else
    3.11 +#    define DECLSPEC
    3.12 +#   endif
    3.13  # else
    3.14  #  if defined(__GNUC__) && __GNUC__ >= 4
    3.15  #   define DECLSPEC __attribute__ ((visibility("default")))
    3.16 @@ -74,6 +80,11 @@
    3.17  #ifndef SDLCALL
    3.18  #if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__)
    3.19  #define SDLCALL __cdecl
    3.20 +#elif defined(__OS2__) || defined(__EMX__)
    3.21 +#define SDLCALL _System
    3.22 +# if defined (__GNUC__) && !defined(_System)
    3.23 +#  define _System /* for old EMX/GCC compat.  */
    3.24 +# endif
    3.25  #else
    3.26  #define SDLCALL
    3.27  #endif