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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
diff --git a/include/SDL_platform.h b/include/SDL_platform.h
index efed8ed..f041ae7 100644
--- a/include/SDL_platform.h
+++ b/include/SDL_platform.h
@@ -97,7 +97,7 @@
#undef __OPENBSD__
#define __OPENBSD__ 1
#endif
-#if defined(__OS2__)
+#if defined(__OS2__) || defined(__EMX__)
#undef __OS2__
#define __OS2__ 1
#endif
diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h
index 762bf45..2d18afb 100644
--- a/include/SDL_syswm.h
+++ b/include/SDL_syswm.h
@@ -125,7 +125,8 @@ typedef enum
SDL_SYSWM_MIR,
SDL_SYSWM_WINRT,
SDL_SYSWM_ANDROID,
- SDL_SYSWM_VIVANTE
+ SDL_SYSWM_VIVANTE,
+ SDL_SYSWM_OS2
} SDL_SYSWM_TYPE;
/**
diff --git a/include/begin_code.h b/include/begin_code.h
index 444068f..1e78a4d 100644
--- a/include/begin_code.h
+++ b/include/begin_code.h
@@ -61,6 +61,12 @@
# else
# define DECLSPEC __declspec(dllexport)
# endif
+# elif defined(__OS2__) && defined(__WATCOMC__)
+# ifdef BUILD_SDL
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC
+# endif
# else
# if defined(__GNUC__) && __GNUC__ >= 4
# define DECLSPEC __attribute__ ((visibility("default")))
@@ -74,6 +80,11 @@
#ifndef SDLCALL
#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__)
#define SDLCALL __cdecl
+#elif defined(__OS2__) || defined(__EMX__)
+#define SDLCALL _System
+# if defined (__GNUC__) && !defined(_System)
+# define _System /* for old EMX/GCC compat. */
+# endif
#else
#define SDLCALL
#endif