Linking Win32 dll with Watcom C 11.0

Hi all,

I would like to know how to link the SDL Win32 library using Watcom C
11.0. Found a previous post with this same question, however the thread
ended before the answer was revealed.

The errors are of the form:

Error! E2028: SDL_Init_ is an undefined reference

I am not experienced in linking dll’s, however, in looking at the header
file, it seems that the DECLSPEC macro properly expands to compile the
dll (__declspec(dllexport)), but not for the program that wants to use
the dll (__declspec(dllimport)).

Can anyone offer assistance?

Regards,
John

Watcom has 2 way of passing parameter, uno is the snandard way (in the
stack), the other in the 80x86 registers.

To detect which of is used the name of the function are ‘decorated’ with
an underscore at the end of the function name if the register passing is
used.

I used the Dll from the SDL site made for windows, building the import
library from the dll (wlib sdl.lib +sdl.dll) using (among other) “-5s
-ei” as option to the compiler.

The “-ei” option is necessary because if not used the alignement of the
struct with enum is wrong (the keyboard event!)

The “-5s” says to watcom to use the 586 (pentium) istruction and to use
the stack calling convention.

Daniele Forghieri

I would like to know how to link the SDL Win32 library using Watcom C
11.0. Found a previous post with this same question, however the thread
ended before the answer was revealed.

Watcom uses a different mangling scheme for symbol names than Visual C
does. Your possible solutions:

  1. Build SDL from source with Watcom’s compiler. I dunno if this works, I
    haven’t tried it.

  2. Use the header I’m attaching to this email. This header was generated
    from the attached Perl script, which looks for global symbols in the Linux
    library (using the Unix ‘nm’ command to do the symbol discovery). The
    header tells Watcom to treat SDL symbols correctly.

If you use option #2, remember to compile your code with the -ei command
switch (“enums are ints”), otherwise most of the enums will be treated as
one instead of four bytes, which makes for some hard-to-find bugs.

Any callbacks you have (such as the function you pass to SDL_OpenAudio()),
need to be flagged as __cdecl:

int my_sdl_event_filter_function(const SDL_Event *event);
#ifdef __WATCOMC__
#pragma aux (__cdecl) my_sdl_event_filter_function;
#endif

That should cover it. Good luck.

–ryan.

-------------- next part --------------
#!/usr/bin/perl -w#

Figures out what SDL symbols need to get flagged as __cdecl to Watcom

compilers, so that SDL can be correctly linked with Watcom tools. Run this

on Linux, and then use the output as SDLSOURCE/include/SDL_watcom.h.

Please inspect the output! If it looks wrong, it probably is.

Written by Ryan C. Gordon. (icculus at clutteredmind.org)

use strict;

open(NM, “nm /usr/local/lib/libSDL.a |grep “T SDL_” |”) ||
die(“Couldn’t exec nm: $!\n”);

print <<EOF;
/*
SDL - Simple DirectMedia Layer
Copyright © 1997, 1998, 1999, 2000, 2001 Sam Lantinga

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Sam Lantinga
slouken\@devolution.com

*/

#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_watcom.h,v 1.4.2.3 2001/02/10 07:20:02 hercules Exp $";
#endif

/*
This is a Watcom C support header. It was autogenerated by a perl script
(watcom_sdl_syms.pl). The perl was written by Ryan C. Gordon
(icculus@clutteredmind.org).
*/

#ifndef _SDL_watcom_h
#define _SDL_watcom_h

#include “begin_code.h”
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern “C” {
#endif

#ifdef WATCOMC
EOF

while () {
chomp;

/........ (.) ([^\/]+)/;

if ($1 eq "T") {  # sanity check.
    print("#pragma aux (__cdecl) $2;\n");
}

}

close(NM);

print <<EOF;

/*

  • Don’t forget to compile your code with wcc386.exe’s -ei option, so that
  • enums in Watcom and SDL are the same size, and remember that any SDL
  • callbacks (for sound or event filtering, etc) in your Watcom C-based code
  • must be labelled as __cdecl. An example:
  • int my_sdl_event_filter_function(const SDL_Event *event);
  • #ifdef WATCOMC
  • #pragma aux (__cdecl) my_sdl_event_filter_function;
  • #endif
  • Have fun, and good luck!   --ryan.  (icculus\@clutteredmind.org)
    

*/

#endif /* WATCOMC */

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
};
#endif
#include “close_code.h”

#endif /* _SDL_watcom_h */

EOF

end of watcom_sdl_syms.pl …

-------------- next part --------------
/*
SDL - Simple DirectMedia Layer
Copyright © 1997, 1998, 1999, 2000, 2001 Sam Lantinga

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Sam Lantinga
slouken at devolution.com

*/

#ifdef SAVE_RCSID
static char rcsid =
"@(#) $Id: SDL_watcom.h,v 1.4.2.3 2001/02/10 07:20:02 hercules Exp $";
#endif

/*
This is a Watcom C support header. It was autogenerated by a perl script
(watcom_sdl_syms.pl). The perl was written by Ryan C. Gordon
(icculus at clutteredmind.org).
*/

#ifndef _SDL_watcom_h
#define _SDL_watcom_h

#include “begin_code.h”
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern “C” {
#endif

#ifdef WATCOMC
#pragma aux (__cdecl) SDL_Init;
#pragma aux (__cdecl) SDL_InitSubSystem;
#pragma aux (__cdecl) SDL_Linked_Version;
#pragma aux (__cdecl) SDL_Quit;
#pragma aux (__cdecl) SDL_QuitSubSystem;
#pragma aux (__cdecl) SDL_WasInit;
#pragma aux (__cdecl) SDL_ClearError;
#pragma aux (__cdecl) SDL_Error;
#pragma aux (__cdecl) SDL_GetError;
#pragma aux (__cdecl) SDL_GetErrorMsg;
#pragma aux (__cdecl) SDL_GetErrorMsgUNICODE;
#pragma aux (__cdecl) SDL_SetError;
#pragma aux (__cdecl) SDL_InstallParachute;
#pragma aux (__cdecl) SDL_UninstallParachute;
#pragma aux (__cdecl) SDL_FreeWAV;
#pragma aux (__cdecl) SDL_LoadWAV_RW;
#pragma aux (__cdecl) SDL_MixAudio;
#pragma aux (__cdecl) SDL_OpenAudioPath;
#pragma aux (__cdecl) SDL_BuildAudioCVT;
#pragma aux (__cdecl) SDL_Convert16LSB;
#pragma aux (__cdecl) SDL_Convert16MSB;
#pragma aux (__cdecl) SDL_Convert8;
#pragma aux (__cdecl) SDL_ConvertAudio;
#pragma aux (__cdecl) SDL_ConvertEndian;
#pragma aux (__cdecl) SDL_ConvertMono;
#pragma aux (__cdecl) SDL_ConvertSign;
#pragma aux (__cdecl) SDL_ConvertStereo;
#pragma aux (__cdecl) SDL_RateDIV2;
#pragma aux (__cdecl) SDL_RateMUL2;
#pragma aux (__cdecl) SDL_RateSLOW;
#pragma aux (__cdecl) SDL_AudioDriverName;
#pragma aux (__cdecl) SDL_AudioInit;
#pragma aux (__cdecl) SDL_AudioQuit;
#pragma aux (__cdecl) SDL_CalculateAudioSpec;
#pragma aux (__cdecl) SDL_CloseAudio;
#pragma aux (__cdecl) SDL_FirstAudioFormat;
#pragma aux (__cdecl) SDL_GetAudioStatus;
#pragma aux (__cdecl) SDL_LockAudio;
#pragma aux (__cdecl) SDL_NextAudioFormat;
#pragma aux (__cdecl) SDL_OpenAudio;
#pragma aux (__cdecl) SDL_PauseAudio;
#pragma aux (__cdecl) SDL_RunAudio;
#pragma aux (__cdecl) SDL_UnlockAudio;
#pragma aux (__cdecl) SDL_AllocAudioMem;
#pragma aux (__cdecl) SDL_FreeAudioMem;
#pragma aux (__cdecl) SDL_LoadBMP_RW;
#pragma aux (__cdecl) SDL_SaveBMP_RW;
#pragma aux (__cdecl) SDL_RLEAlphaBlit;
#pragma aux (__cdecl) SDL_RLEBlit;
#pragma aux (__cdecl) SDL_RLESurface;
#pragma aux (__cdecl) SDL_UnRLESurface;
#pragma aux (__cdecl) SDL_ConvertSurface;
#pragma aux (__cdecl) SDL_CreateRGBSurface;
#pragma aux (__cdecl) SDL_CreateRGBSurfaceFrom;
#pragma aux (__cdecl) SDL_FillRect;
#pragma aux (__cdecl) SDL_FreeSurface;
#pragma aux (__cdecl) SDL_GetClipRect;
#pragma aux (__cdecl) SDL_LockSurface;
#pragma aux (__cdecl) SDL_LowerBlit;
#pragma aux (__cdecl) SDL_SetAlpha;
#pragma aux (__cdecl) SDL_SetClipRect;
#pragma aux (__cdecl) SDL_SetColorKey;
#pragma aux (__cdecl) SDL_UnlockSurface;
#pragma aux (__cdecl) SDL_UpperBlit;
#pragma aux (__cdecl) SDL_CalculateBlit;
#pragma aux (__cdecl) SDL_CreateYUVOverlay;
#pragma aux (__cdecl) SDL_DisplayYUVOverlay;
#pragma aux (__cdecl) SDL_FreeYUVOverlay;
#pragma aux (__cdecl) SDL_LockYUVOverlay;
#pragma aux (__cdecl) SDL_UnlockYUVOverlay;
#pragma aux (__cdecl) SDL_CalculateBlit0;
#pragma aux (__cdecl) SDL_CalculateBlit1;
#pragma aux (__cdecl) SDL_CalculateAlphaBlit;
#pragma aux (__cdecl) SDL_CalculateBlitN;
#pragma aux (__cdecl) SDL_AllocBlitMap;
#pragma aux (__cdecl) SDL_AllocFormat;
#pragma aux (__cdecl) SDL_ApplyGamma;
#pragma aux (__cdecl) SDL_CalculatePitch;
#pragma aux (__cdecl) SDL_DitherColors;
#pragma aux (__cdecl) SDL_FindColor;
#pragma aux (__cdecl) SDL_FormatChanged;
#pragma aux (__cdecl) SDL_FreeBlitMap;
#pragma aux (__cdecl) SDL_FreeFormat;
#pragma aux (__cdecl) SDL_GetRGB;
#pragma aux (__cdecl) SDL_GetRGBA;
#pragma aux (__cdecl) SDL_InvalidateMap;
#pragma aux (__cdecl) SDL_MapRGB;
#pragma aux (__cdecl) SDL_MapRGBA;
#pragma aux (__cdecl) SDL_MapSurface;
#pragma aux (__cdecl) SDL_ReallocFormat;
#pragma aux (__cdecl) SDL_SoftStretch;
#pragma aux (__cdecl) SDL_GetGamma;
#pragma aux (__cdecl) SDL_GetGammaRamp;
#pragma aux (__cdecl) SDL_SetGamma;
#pragma aux (__cdecl) SDL_SetGammaRamp;
#pragma aux (__cdecl) SDL_CreateYUV_SW;
#pragma aux (__cdecl) SDL_DisplayYUV_SW;
#pragma aux (__cdecl) SDL_FreeYUV_SW;
#pragma aux (__cdecl) SDL_LockYUV_SW;
#pragma aux (__cdecl) SDL_UnlockYUV_SW;
#pragma aux (__cdecl) SDL_DisplayFormat;
#pragma aux (__cdecl) SDL_DisplayFormatAlpha;
#pragma aux (__cdecl) SDL_Flip;
#pragma aux (__cdecl) SDL_GL_GetAttribute;
#pragma aux (__cdecl) SDL_GL_GetProcAddress;
#pragma aux (__cdecl) SDL_GL_LoadLibrary;
#pragma aux (__cdecl) SDL_GL_Lock;
#pragma aux (__cdecl) SDL_GL_SetAttribute;
#pragma aux (__cdecl) SDL_GL_SwapBuffers;
#pragma aux (__cdecl) SDL_GL_Unlock;
#pragma aux (__cdecl) SDL_GL_UpdateRects;
#pragma aux (__cdecl) SDL_GL_UpdateRectsLock;
#pragma aux (__cdecl) SDL_GetVideoInfo;
#pragma aux (__cdecl) SDL_GetVideoSurface;
#pragma aux (__cdecl) SDL_GetWMInfo;
#pragma aux (__cdecl) SDL_ListModes;
#pragma aux (__cdecl) SDL_SetColors;
#pragma aux (__cdecl) SDL_SetPalette;
#pragma aux (__cdecl) SDL_SetVideoMode;
#pragma aux (__cdecl) SDL_UpdateRect;
#pragma aux (__cdecl) SDL_UpdateRects;
#pragma aux (__cdecl) SDL_VideoDriverName;
#pragma aux (__cdecl) SDL_VideoInit;
#pragma aux (__cdecl) SDL_VideoModeOK;
#pragma aux (__cdecl) SDL_VideoQuit;
#pragma aux (__cdecl) SDL_WM_GetCaption;
#pragma aux (__cdecl) SDL_WM_GrabInput;
#pragma aux (__cdecl) SDL_WM_IconifyWindow;
#pragma aux (__cdecl) SDL_WM_SetCaption;
#pragma aux (__cdecl) SDL_WM_SetIcon;
#pragma aux (__cdecl) SDL_WM_ToggleFullScreen;
#pragma aux (__cdecl) SDL_CreateCursor;
#pragma aux (__cdecl) SDL_CursorInit;
#pragma aux (__cdecl) SDL_CursorPaletteChanged;
#pragma aux (__cdecl) SDL_CursorQuit;
#pragma aux (__cdecl) SDL_DrawCursor;
#pragma aux (__cdecl) SDL_DrawCursorNoLock;
#pragma aux (__cdecl) SDL_EraseCursor;
#pragma aux (__cdecl) SDL_EraseCursorNoLock;
#pragma aux (__cdecl) SDL_FreeCursor;
#pragma aux (__cdecl) SDL_GetCursor;
#pragma aux (__cdecl) SDL_MouseRect;
#pragma aux (__cdecl) SDL_MoveCursor;
#pragma aux (__cdecl) SDL_ResetCursor;
#pragma aux (__cdecl) SDL_SetCursor;
#pragma aux (__cdecl) SDL_ShowCursor;
#pragma aux (__cdecl) SDL_WarpMouse;
#pragma aux (__cdecl) SDL_CheckKeyRepeat;
#pragma aux (__cdecl) SDL_EnableKeyRepeat;
#pragma aux (__cdecl) SDL_EnableUNICODE;
#pragma aux (__cdecl) SDL_GetKeyName;
#pragma aux (__cdecl) SDL_GetKeyState;
#pragma aux (__cdecl) SDL_GetModState;
#pragma aux (__cdecl) SDL_KeyboardInit;
#pragma aux (__cdecl) SDL_PrivateKeyboard;
#pragma aux (__cdecl) SDL_ResetKeyboard;
#pragma aux (__cdecl) SDL_SetModState;
#pragma aux (__cdecl) SDL_AppActiveInit;
#pragma aux (__cdecl) SDL_GetAppState;
#pragma aux (__cdecl) SDL_PrivateAppActive;
#pragma aux (__cdecl) SDL_PrivateExpose;
#pragma aux (__cdecl) SDL_GetMouseState;
#pragma aux (__cdecl) SDL_GetRelativeMouseState;
#pragma aux (__cdecl) SDL_MouseInit;
#pragma aux (__cdecl) SDL_PrivateMouseButton;
#pragma aux (__cdecl) SDL_PrivateMouseMotion;
#pragma aux (__cdecl) SDL_EventState;
#pragma aux (__cdecl) SDL_EventThreadID;
#pragma aux (__cdecl) SDL_GetEventFilter;
#pragma aux (__cdecl) SDL_Lock_EventThread;
#pragma aux (__cdecl) SDL_PeepEvents;
#pragma aux (__cdecl) SDL_PollEvent;
#pragma aux (__cdecl) SDL_PrivateSysWMEvent;
#pragma aux (__cdecl) SDL_PumpEvents;
#pragma aux (__cdecl) SDL_PushEvent;
#pragma aux (__cdecl) SDL_SetEventFilter;
#pragma aux (__cdecl) SDL_StartEventLoop;
#pragma aux (__cdecl) SDL_StopEventLoop;
#pragma aux (__cdecl) SDL_Unlock_EventThread;
#pragma aux (__cdecl) SDL_WaitEvent;
#pragma aux (__cdecl) SDL_PrivateQuit;
#pragma aux (__cdecl) SDL_QuitInit;
#pragma aux (__cdecl) SDL_PrivateResize;
#pragma aux (__cdecl) SDL_SYS_JoystickClose;
#pragma aux (__cdecl) SDL_SYS_JoystickInit;
#pragma aux (__cdecl) SDL_SYS_JoystickName;
#pragma aux (__cdecl) SDL_SYS_JoystickOpen;
#pragma aux (__cdecl) SDL_SYS_JoystickQuit;
#pragma aux (__cdecl) SDL_SYS_JoystickUpdate;
#pragma aux (__cdecl) SDL_JoystickClose;
#pragma aux (__cdecl) SDL_JoystickEventState;
#pragma aux (__cdecl) SDL_JoystickGetAxis;
#pragma aux (__cdecl) SDL_JoystickGetBall;
#pragma aux (__cdecl) SDL_JoystickGetButton;
#pragma aux (__cdecl) SDL_JoystickGetHat;
#pragma aux (__cdecl) SDL_JoystickIndex;
#pragma aux (__cdecl) SDL_JoystickInit;
#pragma aux (__cdecl) SDL_JoystickName;
#pragma aux (__cdecl) SDL_JoystickNumAxes;
#pragma aux (__cdecl) SDL_JoystickNumBalls;
#pragma aux (__cdecl) SDL_JoystickNumButtons;
#pragma aux (__cdecl) SDL_JoystickNumHats;
#pragma aux (__cdecl) SDL_JoystickOpen;
#pragma aux (__cdecl) SDL_JoystickOpened;
#pragma aux (__cdecl) SDL_JoystickQuit;
#pragma aux (__cdecl) SDL_JoystickUpdate;
#pragma aux (__cdecl) SDL_NumJoysticks;
#pragma aux (__cdecl) SDL_PrivateJoystickAxis;
#pragma aux (__cdecl) SDL_PrivateJoystickBall;
#pragma aux (__cdecl) SDL_PrivateJoystickButton;
#pragma aux (__cdecl) SDL_PrivateJoystickHat;
#pragma aux (__cdecl) SDL_SYS_CDInit;
#pragma aux (__cdecl) SDL_SYS_CDQuit;
#pragma aux (__cdecl) SDL_CDClose;
#pragma aux (__cdecl) SDL_CDEject;
#pragma aux (__cdecl) SDL_CDName;
#pragma aux (__cdecl) SDL_CDNumDrives;
#pragma aux (__cdecl) SDL_CDOpen;
#pragma aux (__cdecl) SDL_CDPause;
#pragma aux (__cdecl) SDL_CDPlay;
#pragma aux (__cdecl) SDL_CDPlayTracks;
#pragma aux (__cdecl) SDL_CDROMInit;
#pragma aux (__cdecl) SDL_CDROMQuit;
#pragma aux (__cdecl) SDL_CDResume;
#pragma aux (__cdecl) SDL_CDStatus;
#pragma aux (__cdecl) SDL_CDStop;
#pragma aux (__cdecl) SDL_SYS_CreateThread;
#pragma aux (__cdecl) SDL_SYS_KillThread;
#pragma aux (__cdecl) SDL_SYS_SetupThread;
#pragma aux (__cdecl) SDL_SYS_WaitThread;
#pragma aux (__cdecl) SDL_ThreadID;
#pragma aux (__cdecl) SDL_CreateMutex;
#pragma aux (__cdecl) SDL_DestroyMutex;
#pragma aux (__cdecl) SDL_mutexP;
#pragma aux (__cdecl) SDL_mutexV;
#pragma aux (__cdecl) SDL_CreateThread;
#pragma aux (__cdecl) SDL_GetErrBuf;
#pragma aux (__cdecl) SDL_GetThreadID;
#pragma aux (__cdecl) SDL_KillThread;
#pragma aux (__cdecl) SDL_RunThread;
#pragma aux (__cdecl) SDL_ThreadsInit;
#pragma aux (__cdecl) SDL_ThreadsQuit;
#pragma aux (__cdecl) SDL_WaitThread;
#pragma aux (__cdecl) SDL_CreateSemaphore;
#pragma aux (__cdecl) SDL_DestroySemaphore;
#pragma aux (__cdecl) SDL_SemPost;
#pragma aux (__cdecl) SDL_SemTryWait;
#pragma aux (__cdecl) SDL_SemValue;
#pragma aux (__cdecl) SDL_SemWait;
#pragma aux (__cdecl) SDL_SemWaitTimeout;
#pragma aux (__cdecl) SDL_CondBroadcast;
#pragma aux (__cdecl) SDL_CondSignal;
#pragma aux (__cdecl) SDL_CondWait;
#pragma aux (__cdecl) SDL_CondWaitTimeout;
#pragma aux (__cdecl) SDL_CreateCond;
#pragma aux (__cdecl) SDL_DestroyCond;
#pragma aux (__cdecl) SDL_Delay;
#pragma aux (__cdecl) SDL_GetTicks;
#pragma aux (__cdecl) SDL_SYS_StartTimer;
#pragma aux (__cdecl) SDL_SYS_StopTimer;
#pragma aux (__cdecl) SDL_SYS_TimerInit;
#pragma aux (__cdecl) SDL_SYS_TimerQuit;
#pragma aux (__cdecl) SDL_StartTicks;
#pragma aux (__cdecl) SDL_AddTimer;
#pragma aux (__cdecl) SDL_RemoveTimer;
#pragma aux (__cdecl) SDL_SetTimer;
#pragma aux (__cdecl) SDL_SetTimerThreaded;
#pragma aux (__cdecl) SDL_ThreadedTimerCheck;
#pragma aux (__cdecl) SDL_TimerInit;
#pragma aux (__cdecl) SDL_TimerQuit;
#pragma aux (__cdecl) SDL_ReadBE16;
#pragma aux (__cdecl) SDL_ReadBE32;
#pragma aux (__cdecl) SDL_ReadBE64;
#pragma aux (__cdecl) SDL_ReadLE16;
#pragma aux (__cdecl) SDL_ReadLE32;
#pragma aux (__cdecl) SDL_ReadLE64;
#pragma aux (__cdecl) SDL_WriteBE16;
#pragma aux (__cdecl) SDL_WriteBE32;
#pragma aux (__cdecl) SDL_WriteBE64;
#pragma aux (__cdecl) SDL_WriteLE16;
#pragma aux (__cdecl) SDL_WriteLE32;
#pragma aux (__cdecl) SDL_WriteLE64;
#pragma aux (__cdecl) SDL_AllocRW;
#pragma aux (__cdecl) SDL_FreeRW;
#pragma aux (__cdecl) SDL_RWFromFP;
#pragma aux (__cdecl) SDL_RWFromFile;
#pragma aux (__cdecl) SDL_RWFromMem;

/*

  • Don’t forget to compile your code with wcc386.exe’s -ei option, so that
  • enums in Watcom and SDL are the same size, and remember that any SDL
  • callbacks (for sound or event filtering, etc) in your Watcom C-based code
  • must be labelled as __cdecl. An example:
  • int my_sdl_event_filter_function(const SDL_Event *event);
  • #ifdef WATCOMC
  • #pragma aux (__cdecl) my_sdl_event_filter_function;
  • #endif
  • Have fun, and good luck!   --ryan.  (icculus at clutteredmind.org)
    

*/

#endif /* WATCOMC */

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
};
#endif
#include “close_code.h”

#endif /* _SDL_watcom_h */

/* Set up for C function definitions, even when using C++ */

I actually need to set the calling convention for all the SDL functions.

Thanks for the reminder!

-Sam Lantinga, Software Engineer, Blizzard Entertainment

Watcom uses a different mangling scheme for symbol names than Visual C
does.

Hey Ryan, I’ve explicitly set the SDL API calling convention in the CVS
headers, so aside from the useful comments, SDL_watcom.h shouldn’t be
needed anymore.

Can you double check that this is the case?

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Can you double check that this is the case?

I don’t have a convenient Watcom install at the moment, but it will
probably work.

I’ve been told that __cdecl makes Borland’s compiler stick in an extra
underscore, but I can’t confirm that, and it’s easy to fix that #ifdef if
it proves to be true in the future.

–ryan.