summaryrefslogtreecommitdiff
path: root/include/begin_code.h
diff options
context:
space:
mode:
authorRyan C. Gordon <icculus@icculus.org>2010-01-06 20:58:03 +0000
committerRyan C. Gordon <icculus@icculus.org>2010-01-06 20:58:03 +0000
commit1fad5ac7c11a0a2fcdfc24bff0dcd1a221d59977 (patch)
tree7f5e2498bba0328e612dfac7376be59f54c60cdc /include/begin_code.h
parent8d46b44026d53fcbb3b8f83f03820b2490816765 (diff)
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.
Diffstat (limited to 'include/begin_code.h')
-rw-r--r--include/begin_code.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/include/begin_code.h b/include/begin_code.h
index 2242e8c9bd..8982d244f3 100644
--- a/include/begin_code.h
+++ b/include/begin_code.h
@@ -52,6 +52,12 @@
# else
# define DECLSPEC __declspec(dllexport)
# endif
+# elif defined(__OS2__)
+# ifdef BUILD_SDL
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC
+# endif
# else
# if defined(__GNUC__) && __GNUC__ >= 4
# define DECLSPEC __attribute__ ((visibility("default")))
@@ -63,11 +69,18 @@
/* By default SDL uses the C calling convention */
#ifndef SDLCALL
-#if defined(__WIN32__) && !defined(__GNUC__)
-#define SDLCALL __cdecl
-#else
-#define SDLCALL
-#endif
+# if defined(__WIN32__) && !defined(__GNUC__)
+# define SDLCALL __cdecl
+# elif defined(__OS2__)
+ /* Use the _System calling convention to be compatible with every OS/2
+ compiler. (Please note that this used to be _cdecl for GCC, but that
+ was a bug. Someone should go examine and fix the XFree86 integration
+ instead. We shouldn't be passing SDLCALL function pointers between SDL
+ and XFree86!) */
+# define SDLCALL _System
+# else
+# define SDLCALL
+# endif
#endif /* SDLCALL */
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */