Skip to content

Commit

Permalink
external libs, libmodplug: a few watcom compatibility stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Nov 24, 2019
1 parent 702bb3f commit 1cd03e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions external/libmodplug-0.8.9.0/src/libmodplug/stdafx.h
Expand Up @@ -82,6 +82,11 @@ inline void ProcessPlugins(int n) {}
#include <malloc.h>
#endif

#ifdef __WATCOMC__
#define srandom(_seed) srand(_seed)
#define random() rand()
#endif

typedef int8_t CHAR;
typedef uint8_t UCHAR;
typedef uint8_t* PUCHAR;
Expand Down Expand Up @@ -142,6 +147,12 @@ inline void ProcessPlugins(int n) {}
# else
# define MODPLUG_EXPORT __declspec(dllimport) /* using libmodplug dll for windows */
# endif
#elif defined(__OS2__) && defined(__WATCOMC__)
# if defined(MODPLUG_BUILD) && defined(__SW_BD) /* building libmodplug as a dll for os/2 */
# define MODPLUG_EXPORT __declspec(dllexport)
# else
# define MODPLUG_EXPORT /* using dll or static libmodplug for os/2 */
# endif
#elif defined(MODPLUG_BUILD) && defined(SYM_VISIBILITY)
# define MODPLUG_EXPORT __attribute__((visibility("default")))
#else
Expand Down
8 changes: 7 additions & 1 deletion external/libmodplug-0.8.9.0/src/modplug.h
Expand Up @@ -19,6 +19,12 @@ extern "C" {
# else
# define MODPLUG_EXPORT __declspec(dllimport) /* using libmodplug dll for windows */
# endif
#elif defined(__OS2__) && defined(__WATCOMC__)
# if defined(MODPLUG_BUILD) && defined(__SW_BD) /* building libmodplug as a dll for os/2 */
# define MODPLUG_EXPORT __declspec(dllexport)
# else
# define MODPLUG_EXPORT /* using dll or static libmodplug for os/2 */
# endif
#elif defined(MODPLUG_BUILD) && defined(SYM_VISIBILITY)
# define MODPLUG_EXPORT __attribute__((visibility("default")))
#else
Expand Down Expand Up @@ -164,4 +170,4 @@ MODPLUG_EXPORT void ModPlug_UnloadMixerCallback(ModPlugFile* file) ;
} /* extern "C" */
#endif

#endif
#endif /* MODPLUG_H__INCLUDED */

0 comments on commit 1cd03e8

Please sign in to comment.