Commit 808d714d authored by Sam Lantinga's avatar Sam Lantinga

Explicitly specify the SDL API calling convention (C by default)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40338
parent 16d7ff7c
...@@ -69,24 +69,24 @@ extern "C" { ...@@ -69,24 +69,24 @@ extern "C" {
* Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
* signal handlers for some commonly ignored fatal signals (like SIGSEGV) * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
*/ */
extern DECLSPEC int SDL_Init(Uint32 flags); extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
/* This function initializes specific SDL subsystems */ /* This function initializes specific SDL subsystems */
extern DECLSPEC int SDL_InitSubSystem(Uint32 flags); extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
/* This function cleans up specific SDL subsystems */ /* This function cleans up specific SDL subsystems */
extern DECLSPEC void SDL_QuitSubSystem(Uint32 flags); extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
/* This function returns mask of the specified subsystems which have /* This function returns mask of the specified subsystems which have
been initialized. been initialized.
If 'flags' is 0, it returns a mask of all initialized subsystems. If 'flags' is 0, it returns a mask of all initialized subsystems.
*/ */
extern DECLSPEC Uint32 SDL_WasInit(Uint32 flags); extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
/* This function cleans up all initialized subsystems and unloads the /* This function cleans up all initialized subsystems and unloads the
* dynamically linked library. You should call it upon all exit conditions. * dynamically linked library. You should call it upon all exit conditions.
*/ */
extern DECLSPEC void SDL_Quit(void); extern DECLSPEC void SDLCALL SDL_Quit(void);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -48,7 +48,7 @@ extern "C" { ...@@ -48,7 +48,7 @@ extern "C" {
* SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
* see your application, otherwise it has been iconified or disabled. * see your application, otherwise it has been iconified or disabled.
*/ */
extern DECLSPEC Uint8 SDL_GetAppState(void); extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -105,14 +105,14 @@ typedef struct SDL_AudioCVT { ...@@ -105,14 +105,14 @@ typedef struct SDL_AudioCVT {
* have a specific need to specify the audio driver you want to use. * have a specific need to specify the audio driver you want to use.
* You should normally use SDL_Init() or SDL_InitSubSystem(). * You should normally use SDL_Init() or SDL_InitSubSystem().
*/ */
extern DECLSPEC int SDL_AudioInit(const char *driver_name); extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
extern DECLSPEC void SDL_AudioQuit(void); extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
/* This function fills the given character buffer with the name of the /* This function fills the given character buffer with the name of the
* current audio driver, and returns a pointer to it if the audio driver has * current audio driver, and returns a pointer to it if the audio driver has
* been initialized. It returns NULL if no driver has been initialized. * been initialized. It returns NULL if no driver has been initialized.
*/ */
extern DECLSPEC char *SDL_AudioDriverName(char *namebuf, int maxlen); extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
/* /*
* This function opens the audio device with the desired parameters, and * This function opens the audio device with the desired parameters, and
...@@ -155,7 +155,7 @@ extern DECLSPEC char *SDL_AudioDriverName(char *namebuf, int maxlen); ...@@ -155,7 +155,7 @@ extern DECLSPEC char *SDL_AudioDriverName(char *namebuf, int maxlen);
* may modify the requested size of the audio buffer, you should allocate * may modify the requested size of the audio buffer, you should allocate
* any local mixing buffers after you open the audio device. * any local mixing buffers after you open the audio device.
*/ */
extern DECLSPEC int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained);
/* /*
* Get the current audio state: * Get the current audio state:
...@@ -165,7 +165,7 @@ typedef enum { ...@@ -165,7 +165,7 @@ typedef enum {
SDL_AUDIO_PLAYING, SDL_AUDIO_PLAYING,
SDL_AUDIO_PAUSED SDL_AUDIO_PAUSED
} SDL_audiostatus; } SDL_audiostatus;
extern DECLSPEC SDL_audiostatus SDL_GetAudioStatus(void); extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void);
/* /*
* This function pauses and unpauses the audio callback processing. * This function pauses and unpauses the audio callback processing.
...@@ -174,7 +174,7 @@ extern DECLSPEC SDL_audiostatus SDL_GetAudioStatus(void); ...@@ -174,7 +174,7 @@ extern DECLSPEC SDL_audiostatus SDL_GetAudioStatus(void);
* data for your callback function after opening the audio device. * data for your callback function after opening the audio device.
* Silence will be written to the audio device during the pause. * Silence will be written to the audio device during the pause.
*/ */
extern DECLSPEC void SDL_PauseAudio(int pause_on); extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
/* /*
* This function loads a WAVE from the data source, automatically freeing * This function loads a WAVE from the data source, automatically freeing
...@@ -193,8 +193,7 @@ extern DECLSPEC void SDL_PauseAudio(int pause_on); ...@@ -193,8 +193,7 @@ extern DECLSPEC void SDL_PauseAudio(int pause_on);
* wave file cannot be opened, uses an unknown data format, or is * wave file cannot be opened, uses an unknown data format, or is
* corrupt. Currently raw and MS-ADPCM WAVE files are supported. * corrupt. Currently raw and MS-ADPCM WAVE files are supported.
*/ */
extern DECLSPEC SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
/* Compatibility convenience function -- loads a WAV from a file */ /* Compatibility convenience function -- loads a WAV from a file */
#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
...@@ -203,7 +202,7 @@ extern DECLSPEC SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, ...@@ -203,7 +202,7 @@ extern DECLSPEC SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc,
/* /*
* This function frees data previously allocated with SDL_LoadWAV_RW() * This function frees data previously allocated with SDL_LoadWAV_RW()
*/ */
extern DECLSPEC void SDL_FreeWAV(Uint8 *audio_buf); extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf);
/* /*
* This function takes a source format and rate and a destination format * This function takes a source format and rate and a destination format
...@@ -212,7 +211,7 @@ extern DECLSPEC void SDL_FreeWAV(Uint8 *audio_buf); ...@@ -212,7 +211,7 @@ extern DECLSPEC void SDL_FreeWAV(Uint8 *audio_buf);
* to the other. * to the other.
* This function returns 0, or -1 if there was an error. * This function returns 0, or -1 if there was an error.
*/ */
extern DECLSPEC int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 src_format, Uint8 src_channels, int src_rate,
Uint16 dst_format, Uint8 dst_channels, int dst_rate); Uint16 dst_format, Uint8 dst_channels, int dst_rate);
...@@ -224,7 +223,7 @@ extern DECLSPEC int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, ...@@ -224,7 +223,7 @@ extern DECLSPEC int SDL_BuildAudioCVT(SDL_AudioCVT *cvt,
* cvt->buf should be allocated after the cvt structure is initialized by * cvt->buf should be allocated after the cvt structure is initialized by
* SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long.
*/ */
extern DECLSPEC int SDL_ConvertAudio(SDL_AudioCVT *cvt); extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt);
/* /*
* This takes two audio buffers of the playing audio format and mixes * This takes two audio buffers of the playing audio format and mixes
...@@ -234,7 +233,7 @@ extern DECLSPEC int SDL_ConvertAudio(SDL_AudioCVT *cvt); ...@@ -234,7 +233,7 @@ extern DECLSPEC int SDL_ConvertAudio(SDL_AudioCVT *cvt);
* This is provided for convenience -- you can mix your own audio data. * This is provided for convenience -- you can mix your own audio data.
*/ */
#define SDL_MIX_MAXVOLUME 128 #define SDL_MIX_MAXVOLUME 128
extern DECLSPEC void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume);
/* /*
* The lock manipulated by these functions protects the callback function. * The lock manipulated by these functions protects the callback function.
...@@ -242,13 +241,13 @@ extern DECLSPEC void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int ...@@ -242,13 +241,13 @@ extern DECLSPEC void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int
* callback function is not running. Do not call these from the callback * callback function is not running. Do not call these from the callback
* function or you will cause deadlock. * function or you will cause deadlock.
*/ */
extern DECLSPEC void SDL_LockAudio(void); extern DECLSPEC void SDLCALL SDL_LockAudio(void);
extern DECLSPEC void SDL_UnlockAudio(void); extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
/* /*
* This function shuts down audio processing and closes the audio device. * This function shuts down audio processing and closes the audio device.
*/ */
extern DECLSPEC void SDL_CloseAudio(void); extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -99,7 +99,7 @@ typedef struct SDL_CD { ...@@ -99,7 +99,7 @@ typedef struct SDL_CD {
/* Returns the number of CD-ROM drives on the system, or -1 if /* Returns the number of CD-ROM drives on the system, or -1 if
SDL_Init() has not been called with the SDL_INIT_CDROM flag. SDL_Init() has not been called with the SDL_INIT_CDROM flag.
*/ */
extern DECLSPEC int SDL_CDNumDrives(void); extern DECLSPEC int SDLCALL SDL_CDNumDrives(void);
/* Returns a human-readable, system-dependent identifier for the CD-ROM. /* Returns a human-readable, system-dependent identifier for the CD-ROM.
Example: Example:
...@@ -107,7 +107,7 @@ extern DECLSPEC int SDL_CDNumDrives(void); ...@@ -107,7 +107,7 @@ extern DECLSPEC int SDL_CDNumDrives(void);
"E:" "E:"
"/dev/disk/ide/1/master" "/dev/disk/ide/1/master"
*/ */
extern DECLSPEC const char * SDL_CDName(int drive); extern DECLSPEC const char * SDLCALL SDL_CDName(int drive);
/* Opens a CD-ROM drive for access. It returns a drive handle on success, /* Opens a CD-ROM drive for access. It returns a drive handle on success,
or NULL if the drive was invalid or busy. This newly opened CD-ROM or NULL if the drive was invalid or busy. This newly opened CD-ROM
...@@ -115,13 +115,13 @@ extern DECLSPEC const char * SDL_CDName(int drive); ...@@ -115,13 +115,13 @@ extern DECLSPEC const char * SDL_CDName(int drive);
CD-ROM handle. CD-ROM handle.
Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.
*/ */
extern DECLSPEC SDL_CD * SDL_CDOpen(int drive); extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive);
/* This function returns the current status of the given drive. /* This function returns the current status of the given drive.
If the drive has a CD in it, the table of contents of the CD and current If the drive has a CD in it, the table of contents of the CD and current
play position of the CD will be stored in the SDL_CD structure. play position of the CD will be stored in the SDL_CD structure.
*/ */
extern DECLSPEC CDstatus SDL_CDStatus(SDL_CD *cdrom); extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom);
/* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' /* Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
...@@ -142,28 +142,28 @@ extern DECLSPEC CDstatus SDL_CDStatus(SDL_CD *cdrom); ...@@ -142,28 +142,28 @@ extern DECLSPEC CDstatus SDL_CDStatus(SDL_CD *cdrom);
This function returns 0, or -1 if there was an error. This function returns 0, or -1 if there was an error.
*/ */
extern DECLSPEC int SDL_CDPlayTracks(SDL_CD *cdrom, extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom,
int start_track, int start_frame, int ntracks, int nframes); int start_track, int start_frame, int ntracks, int nframes);
/* Play the given CD starting at 'start' frame for 'length' frames. /* Play the given CD starting at 'start' frame for 'length' frames.
It returns 0, or -1 if there was an error. It returns 0, or -1 if there was an error.
*/ */
extern DECLSPEC int SDL_CDPlay(SDL_CD *cdrom, int start, int length); extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length);
/* Pause play -- returns 0, or -1 on error */ /* Pause play -- returns 0, or -1 on error */
extern DECLSPEC int SDL_CDPause(SDL_CD *cdrom); extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom);
/* Resume play -- returns 0, or -1 on error */ /* Resume play -- returns 0, or -1 on error */
extern DECLSPEC int SDL_CDResume(SDL_CD *cdrom); extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom);
/* Stop play -- returns 0, or -1 on error */ /* Stop play -- returns 0, or -1 on error */
extern DECLSPEC int SDL_CDStop(SDL_CD *cdrom); extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom);
/* Eject CD-ROM -- returns 0, or -1 on error */ /* Eject CD-ROM -- returns 0, or -1 on error */
extern DECLSPEC int SDL_CDEject(SDL_CD *cdrom); extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom);
/* Closes the handle for the CD-ROM drive */ /* Closes the handle for the CD-ROM drive */
extern DECLSPEC void SDL_CDClose(SDL_CD *cdrom); extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -124,20 +124,20 @@ static __inline__ Uint64 SDL_Swap64(Uint64 val) { ...@@ -124,20 +124,20 @@ static __inline__ Uint64 SDL_Swap64(Uint64 val) {
#endif #endif
/* Read an item of the specified endianness and return in native format */ /* Read an item of the specified endianness and return in native format */
extern DECLSPEC Uint16 SDL_ReadLE16(SDL_RWops *src); extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
extern DECLSPEC Uint16 SDL_ReadBE16(SDL_RWops *src); extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
extern DECLSPEC Uint32 SDL_ReadLE32(SDL_RWops *src); extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
extern DECLSPEC Uint32 SDL_ReadBE32(SDL_RWops *src); extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
extern DECLSPEC Uint64 SDL_ReadLE64(SDL_RWops *src); extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
extern DECLSPEC Uint64 SDL_ReadBE64(SDL_RWops *src); extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
/* Write an item of native format to the specified endianness */ /* Write an item of native format to the specified endianness */
extern DECLSPEC int SDL_WriteLE16(SDL_RWops *dst, Uint16 value); extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDL_WriteBE16(SDL_RWops *dst, Uint16 value); extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDL_WriteLE32(SDL_RWops *dst, Uint32 value); extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDL_WriteBE32(SDL_RWops *dst, Uint32 value); extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDL_WriteLE64(SDL_RWops *dst, Uint64 value); extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
extern DECLSPEC int SDL_WriteBE64(SDL_RWops *dst, Uint64 value); extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -37,9 +37,9 @@ extern "C" { ...@@ -37,9 +37,9 @@ extern "C" {
#endif #endif
/* Public functions */ /* Public functions */
extern DECLSPEC void SDL_SetError(const char *fmt, ...); extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
extern DECLSPEC char * SDL_GetError(void); extern DECLSPEC char * SDLCALL SDL_GetError(void);
extern DECLSPEC void SDL_ClearError(void); extern DECLSPEC void SDLCALL SDL_ClearError(void);
/* Private error message function - used internally */ /* Private error message function - used internally */
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
......
...@@ -238,7 +238,7 @@ typedef union { ...@@ -238,7 +238,7 @@ typedef union {
This function updates the event queue and internal input device state. This function updates the event queue and internal input device state.
This should only be run in the thread that sets the video mode. This should only be run in the thread that sets the video mode.
*/ */
extern DECLSPEC void SDL_PumpEvents(void); extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
/* Checks the event queue for messages and optionally returns them. /* Checks the event queue for messages and optionally returns them.
If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
...@@ -258,26 +258,26 @@ typedef enum { ...@@ -258,26 +258,26 @@ typedef enum {
SDL_GETEVENT SDL_GETEVENT
} SDL_eventaction; } SDL_eventaction;
/* */ /* */
extern DECLSPEC int SDL_PeepEvents(SDL_Event *events, int numevents, extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents,
SDL_eventaction action, Uint32 mask); SDL_eventaction action, Uint32 mask);
/* Polls for currently pending events, and returns 1 if there are any pending /* Polls for currently pending events, and returns 1 if there are any pending
events, or 0 if there are none available. If 'event' is not NULL, the next events, or 0 if there are none available. If 'event' is not NULL, the next
event is removed from the queue and stored in that area. event is removed from the queue and stored in that area.
*/ */
extern DECLSPEC int SDL_PollEvent(SDL_Event *event); extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event);
/* Waits indefinitely for the next available event, returning 1, or 0 if there /* Waits indefinitely for the next available event, returning 1, or 0 if there
was an error while waiting for events. If 'event' is not NULL, the next was an error while waiting for events. If 'event' is not NULL, the next
event is removed from the queue and stored in that area. event is removed from the queue and stored in that area.
*/ */
extern DECLSPEC int SDL_WaitEvent(SDL_Event *event); extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event);
/* Add an event to the event queue. /* Add an event to the event queue.
This function returns 0 if the event queue was full, or -1 This function returns 0 if the event queue was full, or -1
if there was some other error. Returns 1 on success. if there was some other error. Returns 1 on success.
*/ */
extern DECLSPEC int SDL_PushEvent(SDL_Event *event); extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event);
/* /*
This function sets up a filter to process all events before they This function sets up a filter to process all events before they
...@@ -302,13 +302,13 @@ typedef int (*SDL_EventFilter)(const SDL_Event *event); ...@@ -302,13 +302,13 @@ typedef int (*SDL_EventFilter)(const SDL_Event *event);
If the quit event is generated by an interrupt signal, it will bypass the If the quit event is generated by an interrupt signal, it will bypass the
internal queue and be delivered to the application at the next event poll. internal queue and be delivered to the application at the next event poll.
*/ */
extern DECLSPEC void SDL_SetEventFilter(SDL_EventFilter filter); extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter);
/* /*
Return the current event filter - can be used to "chain" filters. Return the current event filter - can be used to "chain" filters.
If there is no event filter set, this function returns NULL. If there is no event filter set, this function returns NULL.
*/ */
extern DECLSPEC SDL_EventFilter SDL_GetEventFilter(void); extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void);
/* /*
This function allows you to set the state of processing certain events. This function allows you to set the state of processing certain events.
...@@ -322,7 +322,7 @@ extern DECLSPEC SDL_EventFilter SDL_GetEventFilter(void); ...@@ -322,7 +322,7 @@ extern DECLSPEC SDL_EventFilter SDL_GetEventFilter(void);
#define SDL_IGNORE 0 #define SDL_IGNORE 0
#define SDL_DISABLE 0 #define SDL_DISABLE 0
#define SDL_ENABLE 1 #define SDL_ENABLE 1
extern DECLSPEC Uint8 SDL_EventState(Uint8 type, int state); extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -14,11 +14,11 @@ extern "C" { ...@@ -14,11 +14,11 @@ extern "C" {
#endif #endif
/* Put a variable of the form "name=value" into the environment */ /* Put a variable of the form "name=value" into the environment */
extern DECLSPEC int SDL_putenv(const char *variable); extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
#define putenv(X) SDL_putenv(X) #define putenv(X) SDL_putenv(X)
/* Retrieve a variable named "name" from the environment */ /* Retrieve a variable named "name" from the environment */
extern DECLSPEC char *SDL_getenv(const char *name); extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
#define getenv(X) SDL_getenv(X) #define getenv(X) SDL_getenv(X)
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -52,14 +52,14 @@ typedef struct _SDL_Joystick SDL_Joystick; ...@@ -52,14 +52,14 @@ typedef struct _SDL_Joystick SDL_Joystick;
/* /*
* Count the number of joysticks attached to the system * Count the number of joysticks attached to the system
*/ */
extern DECLSPEC int SDL_NumJoysticks(void); extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
/* /*
* Get the implementation dependent name of a joystick. * Get the implementation dependent name of a joystick.
* This can be called before any joysticks are opened. * This can be called before any joysticks are opened.
* If no name can be found, this function returns NULL. * If no name can be found, this function returns NULL.
*/ */
extern DECLSPEC const char *SDL_JoystickName(int device_index); extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index);
/* /*
* Open a joystick for use - the index passed as an argument refers to * Open a joystick for use - the index passed as an argument refers to
...@@ -68,46 +68,46 @@ extern DECLSPEC const char *SDL_JoystickName(int device_index); ...@@ -68,46 +68,46 @@ extern DECLSPEC const char *SDL_JoystickName(int device_index);
* *
* This function returns a joystick identifier, or NULL if an error occurred. * This function returns a joystick identifier, or NULL if an error occurred.
*/ */
extern DECLSPEC SDL_Joystick *SDL_JoystickOpen(int device_index); extern DECLSPEC SDL_Joystick * SDLCALL SDLCALL SDL_JoystickOpen(int device_index);
/* /*
* Returns 1 if the joystick has been opened, or 0 if it has not. * Returns 1 if the joystick has been opened, or 0 if it has not.
*/ */
extern DECLSPEC int SDL_JoystickOpened(int device_index); extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index);
/* /*
* Get the device index of an opened joystick. * Get the device index of an opened joystick.
*/ */
extern DECLSPEC int SDL_JoystickIndex(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick);
/* /*
* Get the number of general axis controls on a joystick * Get the number of general axis controls on a joystick
*/ */
extern DECLSPEC int SDL_JoystickNumAxes(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
/* /*
* Get the number of trackballs on a joystick * Get the number of trackballs on a joystick
* Joystick trackballs have only relative motion events associated * Joystick trackballs have only relative motion events associated
* with them and their state cannot be polled. * with them and their state cannot be polled.
*/ */
extern DECLSPEC int SDL_JoystickNumBalls(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
/* /*
* Get the number of POV hats on a joystick * Get the number of POV hats on a joystick
*/ */
extern DECLSPEC int SDL_JoystickNumHats(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
/* /*
* Get the number of buttons on a joystick * Get the number of buttons on a joystick
*/ */
extern DECLSPEC int SDL_JoystickNumButtons(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
/* /*
* Update the current state of the open joysticks. * Update the current state of the open joysticks.
* This is called automatically by the event loop if any joystick * This is called automatically by the event loop if any joystick
* events are enabled. * events are enabled.
*/ */
extern DECLSPEC void SDL_JoystickUpdate(void); extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
/* /*
* Enable/disable joystick event polling. * Enable/disable joystick event polling.
...@@ -116,14 +116,14 @@ extern DECLSPEC void SDL_JoystickUpdate(void); ...@@ -116,14 +116,14 @@ extern DECLSPEC void SDL_JoystickUpdate(void);
* information. * information.
* The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
*/ */
extern DECLSPEC int SDL_JoystickEventState(int state); extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
/* /*
* Get the current state of an axis control on a joystick * Get the current state of an axis control on a joystick
* The state is a value ranging from -32768 to 32767. * The state is a value ranging from -32768 to 32767.
* The axis indices start at index 0. * The axis indices start at index 0.
*/ */
extern DECLSPEC Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
/* /*
* Get the current state of a POV hat on a joystick * Get the current state of a POV hat on a joystick
...@@ -141,25 +141,25 @@ extern DECLSPEC Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); ...@@ -141,25 +141,25 @@ extern DECLSPEC Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
/* /*
* The hat indices start at index 0. * The hat indices start at index 0.
*/ */
extern DECLSPEC Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
/* /*
* Get the ball axis change since the last poll * Get the ball axis change since the last poll
* This returns 0, or -1 if you passed it invalid parameters. * This returns 0, or -1 if you passed it invalid parameters.
* The ball indices start at index 0. * The ball indices start at index 0.
*/ */
extern DECLSPEC int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
/* /*
* Get the current state of a button on a joystick * Get the current state of a button on a joystick
* The button indices start at index 0. * The button indices start at index 0.
*/ */
extern DECLSPEC Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button); extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
/* /*
* Close a joystick previously opened with SDL_JoystickOpen() * Close a joystick previously opened with SDL_JoystickOpen()
*/ */
extern DECLSPEC void SDL_JoystickClose(SDL_Joystick *joystick); extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -74,7 +74,7 @@ typedef struct { ...@@ -74,7 +74,7 @@ typedef struct {
* If 'enable' is -1, the translation state is not changed. * If 'enable' is -1, the translation state is not changed.
* It returns the previous state of keyboard translation. * It returns the previous state of keyboard translation.
*/ */
extern DECLSPEC int SDL_EnableUNICODE(int enable); extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
/* /*
* Enable/Disable keyboard repeat. Keyboard repeat defaults to off. * Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
...@@ -87,7 +87,7 @@ extern DECLSPEC int SDL_EnableUNICODE(int enable); ...@@ -87,7 +87,7 @@ extern DECLSPEC int SDL_EnableUNICODE(int enable);
/* /*
* If 'delay' is set to 0, keyboard repeat is disabled. * If 'delay' is set to 0, keyboard repeat is disabled.
*/ */
extern DECLSPEC int SDL_EnableKeyRepeat(int delay, int interval); extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
/* /*
* Get a snapshot of the current state of the keyboard. * Get a snapshot of the current state of the keyboard.
...@@ -96,23 +96,23 @@ extern DECLSPEC int SDL_EnableKeyRepeat(int delay, int interval); ...@@ -96,23 +96,23 @@ extern DECLSPEC int SDL_EnableKeyRepeat(int delay, int interval);
* Uint8 *keystate = SDL_GetKeyState(NULL); * Uint8 *keystate = SDL_GetKeyState(NULL);
* if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed. * if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed.
*/ */
extern DECLSPEC Uint8 * SDL_GetKeyState(int *numkeys); extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys);
/* /*
* Get the current key modifier state * Get the current key modifier state
*/ */
extern DECLSPEC SDLMod SDL_GetModState(void); extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
/* /*
* Set the current key modifier state * Set the current key modifier state
* This does not change the keyboard state, only the key modifier flags. * This does not change the keyboard state, only the key modifier flags.
*/ */
extern DECLSPEC void SDL_SetModState(SDLMod modstate); extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
/* /*
* Get the name of an SDL virtual keysym * Get the name of an SDL virtual keysym
*/ */
extern DECLSPEC char * SDL_GetKeyName(SDLKey key); extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -64,9 +64,9 @@ extern "C" { ...@@ -64,9 +64,9 @@ extern "C" {
#endif #endif
/* This should be called from your WinMain() function, if any */ /* This should be called from your WinMain() function, if any */
extern DECLSPEC void SDL_SetModuleHandle(void *hInst); extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
/* This can also be called, but is no longer necessary */ /* This can also be called, but is no longer necessary */
extern DECLSPEC int SDL_RegisterApp(char *name, Uint32 style, void *hInst); extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
#ifdef __cplusplus #ifdef __cplusplus
} }
...@@ -86,7 +86,7 @@ extern "C" { ...@@ -86,7 +86,7 @@ extern "C" {
struct QDGlobals; struct QDGlobals;
/* This should be called from your main() function, if any */ /* This should be called from your main() function, if any */
extern DECLSPEC void SDL_InitQuickDraw(struct QDGlobals *the_qd); extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -56,7 +56,7 @@ typedef struct { ...@@ -56,7 +56,7 @@ typedef struct {
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* current mouse cursor position. You can pass NULL for either x or y. * current mouse cursor position. You can pass NULL for either x or y.
*/ */
extern DECLSPEC Uint8 SDL_GetMouseState(int *x, int *y); extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);
/* /*
* Retrieve the current state of the mouse. * Retrieve the current state of the mouse.
...@@ -64,12 +64,12 @@ extern DECLSPEC Uint8 SDL_GetMouseState(int *x, int *y); ...@@ -64,12 +64,12 @@ extern DECLSPEC Uint8 SDL_GetMouseState(int *x, int *y);
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* mouse deltas since the last call to SDL_GetRelativeMouseState(). * mouse deltas since the last call to SDL_GetRelativeMouseState().
*/ */
extern DECLSPEC Uint8 SDL_GetRelativeMouseState(int *x, int *y); extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
/* /*
* Set the position of the mouse cursor (generates a mouse motion event) * Set the position of the mouse cursor (generates a mouse motion event)
*/ */
extern DECLSPEC void SDL_WarpMouse(Uint16 x, Uint16 y); extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);
/* /*
* Create a cursor using the specified data and mask (in MSB format). * Create a cursor using the specified data and mask (in MSB format).
...@@ -84,7 +84,7 @@ extern DECLSPEC void SDL_WarpMouse(Uint16 x, Uint16 y); ...@@ -84,7 +84,7 @@ extern DECLSPEC void SDL_WarpMouse(Uint16 x, Uint16 y);
* *
* Cursors created with this function must be freed with SDL_FreeCursor(). * Cursors created with this function must be freed with SDL_FreeCursor().
*/ */
extern DECLSPEC SDL_Cursor *SDL_CreateCursor extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
/* /*
...@@ -92,17 +92,17 @@ extern DECLSPEC SDL_Cursor *SDL_CreateCursor ...@@ -92,17 +92,17 @@ extern DECLSPEC SDL_Cursor *SDL_CreateCursor
* If the cursor is currently visible, the change will be immediately * If the cursor is currently visible, the change will be immediately
* represented on the display. * represented on the display.
*/ */
extern DECLSPEC void SDL_SetCursor(SDL_Cursor *cursor); extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
/* /*
* Returns the currently active cursor. * Returns the currently active cursor.
*/ */
extern DECLSPEC SDL_Cursor * SDL_GetCursor(void); extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);
/* /*
* Deallocates a cursor created with SDL_CreateCursor(). * Deallocates a cursor created with SDL_CreateCursor().
*/ */
extern DECLSPEC void SDL_FreeCursor(SDL_Cursor *cursor); extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);
/* /*
* Toggle whether or not the cursor is shown on the screen. * Toggle whether or not the cursor is shown on the screen.
...@@ -111,7 +111,7 @@ extern DECLSPEC void SDL_FreeCursor(SDL_Cursor *cursor); ...@@ -111,7 +111,7 @@ extern DECLSPEC void SDL_FreeCursor(SDL_Cursor *cursor);
* before the call, or 0 if it was not. You can query the current * before the call, or 0 if it was not. You can query the current
* state by passing a 'toggle' value of -1. * state by passing a 'toggle' value of -1.
*/ */
extern DECLSPEC int SDL_ShowCursor(int toggle); extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
/* Used as a mask when testing buttons in buttonstate /* Used as a mask when testing buttons in buttonstate
Button 1: Left mouse button Button 1: Left mouse button
......
...@@ -60,18 +60,18 @@ struct SDL_mutex; ...@@ -60,18 +60,18 @@ struct SDL_mutex;
typedef struct SDL_mutex SDL_mutex; typedef struct SDL_mutex SDL_mutex;
/* Create a mutex, initialized unlocked */ /* Create a mutex, initialized unlocked */
extern DECLSPEC SDL_mutex * SDL_CreateMutex(void); extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void);
/* Lock the mutex (Returns 0, or -1 on error) */ /* Lock the mutex (Returns 0, or -1 on error) */
#define SDL_LockMutex(m) SDL_mutexP(m) #define SDL_LockMutex(m) SDL_mutexP(m)
extern DECLSPEC int SDL_mutexP(SDL_mutex *mutex); extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex);
/* Unlock the mutex (Returns 0, or -1 on error) */ /* Unlock the mutex (Returns 0, or -1 on error) */
#define SDL_UnlockMutex(m) SDL_mutexV(m) #define SDL_UnlockMutex(m) SDL_mutexV(m)
extern DECLSPEC int SDL_mutexV(SDL_mutex *mutex); extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex);
/* Destroy a mutex */ /* Destroy a mutex */
extern DECLSPEC void SDL_DestroyMutex(SDL_mutex *mutex); extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
...@@ -83,21 +83,21 @@ struct SDL_semaphore; ...@@ -83,21 +83,21 @@ struct SDL_semaphore;
typedef struct SDL_semaphore SDL_sem; typedef struct SDL_semaphore SDL_sem;
/* Create a semaphore, initialized with value, returns NULL on failure. */ /* Create a semaphore, initialized with value, returns NULL on failure. */
extern DECLSPEC SDL_sem * SDL_CreateSemaphore(Uint32 initial_value); extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
/* Destroy a semaphore */ /* Destroy a semaphore */
extern DECLSPEC void SDL_DestroySemaphore(SDL_sem *sem); extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem);
/* This function suspends the calling thread until the semaphore pointed /* This function suspends the calling thread until the semaphore pointed
* to by sem has a positive count. It then atomically decreases the semaphore * to by sem has a positive count. It then atomically decreases the semaphore
* count. * count.
*/ */
extern DECLSPEC int SDL_SemWait(SDL_sem *sem); extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem);
/* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds, /* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds,
SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error.
*/ */
extern DECLSPEC int SDL_SemTryWait(SDL_sem *sem); extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem);
/* Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if /* Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
...@@ -105,15 +105,15 @@ extern DECLSPEC int SDL_SemTryWait(SDL_sem *sem); ...@@ -105,15 +105,15 @@ extern DECLSPEC int SDL_SemTryWait(SDL_sem *sem);
On some platforms this function is implemented by looping with a delay On some platforms this function is implemented by looping with a delay
of 1 ms, and so should be avoided if possible. of 1 ms, and so should be avoided if possible.
*/ */
extern DECLSPEC int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms);
/* Atomically increases the semaphore's count (not blocking), returns 0, /* Atomically increases the semaphore's count (not blocking), returns 0,
or -1 on error. or -1 on error.
*/ */
extern DECLSPEC int SDL_SemPost(SDL_sem *sem); extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem);
/* Returns the current count of the semaphore */ /* Returns the current count of the semaphore */
extern DECLSPEC Uint32 SDL_SemValue(SDL_sem *sem); extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
...@@ -125,26 +125,26 @@ struct SDL_cond; ...@@ -125,26 +125,26 @@ struct SDL_cond;
typedef struct SDL_cond SDL_cond; typedef struct SDL_cond SDL_cond;
/* Create a condition variable */ /* Create a condition variable */
extern DECLSPEC SDL_cond * SDL_CreateCond(void); extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void);
/* Destroy a condition variable */ /* Destroy a condition variable */
extern DECLSPEC void SDL_DestroyCond(SDL_cond *cond); extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond);
/* Restart one of the threads that are waiting on the condition variable, /* Restart one of the threads that are waiting on the condition variable,
returns 0 or -1 on error. returns 0 or -1 on error.
*/ */
extern DECLSPEC int SDL_CondSignal(SDL_cond *cond); extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond);
/* Restart all threads that are waiting on the condition variable, /* Restart all threads that are waiting on the condition variable,
returns 0 or -1 on error. returns 0 or -1 on error.
*/ */
extern DECLSPEC int SDL_CondBroadcast(SDL_cond *cond); extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond);
/* Wait on the condition variable, unlocking the provided mutex. /* Wait on the condition variable, unlocking the provided mutex.
The mutex must be locked before entering this function! The mutex must be locked before entering this function!
Returns 0 when it is signaled, or -1 on error. Returns 0 when it is signaled, or -1 on error.
*/ */
extern DECLSPEC int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
/* Waits for at most 'ms' milliseconds, and returns 0 if the condition /* Waits for at most 'ms' milliseconds, and returns 0 if the condition
variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
...@@ -152,7 +152,7 @@ extern DECLSPEC int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); ...@@ -152,7 +152,7 @@ extern DECLSPEC int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);
On some platforms this function is implemented by looping with a delay On some platforms this function is implemented by looping with a delay
of 1 ms, and so should be avoided if possible. of 1 ms, and so should be avoided if possible.
*/ */
extern DECLSPEC int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -87,14 +87,14 @@ typedef struct SDL_RWops { ...@@ -87,14 +87,14 @@ typedef struct SDL_RWops {
/* Functions to create SDL_RWops structures from various data sources */ /* Functions to create SDL_RWops structures from various data sources */
extern DECLSPEC SDL_RWops * SDL_RWFromFile(const char *file, const char *mode); extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);
extern DECLSPEC SDL_RWops * SDL_RWFromFP(FILE *fp, int autoclose); extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
extern DECLSPEC SDL_RWops * SDL_RWFromMem(void *mem, int size); extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size);
extern DECLSPEC SDL_RWops * SDL_AllocRW(void); extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void);
extern DECLSPEC void SDL_FreeRW(SDL_RWops *area); extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);
/* Macros to easily read and write from an SDL_RWops structure */ /* Macros to easily read and write from an SDL_RWops structure */
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) #define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
......
...@@ -153,7 +153,7 @@ typedef struct { ...@@ -153,7 +153,7 @@ typedef struct {
* returns 1 if the function is implemented. If it's not implemented, or * returns 1 if the function is implemented. If it's not implemented, or
* the version member of the 'info' structure is invalid, it returns 0. * the version member of the 'info' structure is invalid, it returns 0.
*/ */
extern DECLSPEC int SDL_GetWMInfo(SDL_SysWMinfo *info); extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -50,24 +50,24 @@ struct SDL_Thread; ...@@ -50,24 +50,24 @@ struct SDL_Thread;
typedef struct SDL_Thread SDL_Thread; typedef struct SDL_Thread SDL_Thread;
/* Create a thread */ /* Create a thread */
extern DECLSPEC SDL_Thread * SDL_CreateThread(int (*fn)(void *), void *data); extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (*fn)(void *), void *data);
/* Get the 32-bit thread identifier for the current thread */ /* Get the 32-bit thread identifier for the current thread */
extern DECLSPEC Uint32 SDL_ThreadID(void); extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
/* Get the 32-bit thread identifier for the specified thread, /* Get the 32-bit thread identifier for the specified thread,
equivalent to SDL_ThreadID() if the specified thread is NULL. equivalent to SDL_ThreadID() if the specified thread is NULL.
*/ */
extern DECLSPEC Uint32 SDL_GetThreadID(SDL_Thread *thread); extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread);
/* Wait for a thread to finish. /* Wait for a thread to finish.
The return code for the thread function is placed in the area The return code for the thread function is placed in the area
pointed to by 'status', if 'status' is not NULL. pointed to by 'status', if 'status' is not NULL.
*/ */
extern DECLSPEC void SDL_WaitThread(SDL_Thread *thread, int *status); extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status);
/* Forcefully kill a thread without worrying about its state */ /* Forcefully kill a thread without worrying about its state */
extern DECLSPEC void SDL_KillThread(SDL_Thread *thread); extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
......
...@@ -48,13 +48,13 @@ extern "C" { ...@@ -48,13 +48,13 @@ extern "C" {
/* Get the number of milliseconds since the SDL library initialization. /* Get the number of milliseconds since the SDL library initialization.
* Note that this value wraps if the program runs for more than ~49 days. * Note that this value wraps if the program runs for more than ~49 days.
*/ */
extern DECLSPEC Uint32 SDL_GetTicks(void); extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
/* Wait a specified number of milliseconds before returning */ /* Wait a specified number of milliseconds before returning */
extern DECLSPEC void SDL_Delay(Uint32 ms); extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
/* Function prototype for the timer callback function */ /* Function prototype for the timer callback function */
typedef Uint32 (*SDL_TimerCallback)(Uint32 interval); typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
/* Set a callback to run after the specified number of milliseconds has /* Set a callback to run after the specified number of milliseconds has
* elapsed. The callback function is passed the current timer interval * elapsed. The callback function is passed the current timer interval
...@@ -82,7 +82,7 @@ typedef Uint32 (*SDL_TimerCallback)(Uint32 interval); ...@@ -82,7 +82,7 @@ typedef Uint32 (*SDL_TimerCallback)(Uint32 interval);
* should not use this function in multi-threaded applications as signals * should not use this function in multi-threaded applications as signals
* to multi-threaded apps have undefined behavior in some implementations. * to multi-threaded apps have undefined behavior in some implementations.
*/ */
extern DECLSPEC int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
/* New timer API, supports multiple timers /* New timer API, supports multiple timers
* Written by Stephane Peter <megastep@lokigames.com> * Written by Stephane Peter <megastep@lokigames.com>
...@@ -94,7 +94,7 @@ extern DECLSPEC int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); ...@@ -94,7 +94,7 @@ extern DECLSPEC int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
* passed in, the periodic alarm continues, otherwise a new alarm is * passed in, the periodic alarm continues, otherwise a new alarm is
* scheduled. If the callback returns 0, the periodic alarm is cancelled. * scheduled. If the callback returns 0, the periodic alarm is cancelled.
*/ */
typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param); typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param);
/* Definition of the timer ID type */ /* Definition of the timer ID type */
typedef struct _SDL_TimerID *SDL_TimerID; typedef struct _SDL_TimerID *SDL_TimerID;
...@@ -102,12 +102,12 @@ typedef struct _SDL_TimerID *SDL_TimerID; ...@@ -102,12 +102,12 @@ typedef struct _SDL_TimerID *SDL_TimerID;
/* Add a new timer to the pool of timers already running. /* Add a new timer to the pool of timers already running.
Returns a timer ID, or NULL when an error occurs. Returns a timer ID, or NULL when an error occurs.
*/ */
extern DECLSPEC SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
/* Remove one of the multiple timers knowing its ID. /* Remove one of the multiple timers knowing its ID.
* Returns a boolean value indicating success. * Returns a boolean value indicating success.
*/ */
extern DECLSPEC SDL_bool SDL_RemoveTimer(SDL_TimerID t); extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -79,7 +79,7 @@ typedef struct { ...@@ -79,7 +79,7 @@ typedef struct {
it should NOT be used to fill a version structure, instead you should it should NOT be used to fill a version structure, instead you should
use the SDL_Version() macro. use the SDL_Version() macro.
*/ */
extern DECLSPEC const SDL_version * SDL_Linked_Version(void); extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void);
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
......
This diff is collapsed.
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
#endif #endif
#define _begin_code_h #define _begin_code_h
/* Make sure the correct platform symbols are defined */
#if !defined(WIN32) && defined(_WIN32)
#define WIN32
#endif /* Windows */
/* Some compilers use a special export keyword */ /* Some compilers use a special export keyword */
#ifndef DECLSPEC #ifndef DECLSPEC
# ifdef __BEOS__ # ifdef __BEOS__
...@@ -56,6 +61,15 @@ ...@@ -56,6 +61,15 @@
# endif # endif
#endif #endif
/* By default SDL uses the C calling convention */
#ifndef SDLCALL
#ifdef WIN32
#define SDLCALL __cdecl
#else
#define SDLCALL
#endif
#endif /* SDLCALL */
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ /* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
#ifdef __SYMBIAN32__ #ifdef __SYMBIAN32__
#undef DECLSPEC #undef DECLSPEC
......
...@@ -9,9 +9,7 @@ while ( ($file = shift(@ARGV)) ) { ...@@ -9,9 +9,7 @@ while ( ($file = shift(@ARGV)) ) {
} }
$file =~ s,.*/,,; $file =~ s,.*/,,;
while (<FILE>) { while (<FILE>) {
if ( /DECLSPEC.*\s\**([^\s\(]+)\(/ ) { if ( /DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
print "_$1\n";
} elsif ( /DECLSPEC.*\s\**([^\s\(]+)$/ ) {
print "_$1\n"; print "_$1\n";
} }
} }
......
...@@ -10,9 +10,7 @@ while ( ($file = shift(@ARGV)) ) { ...@@ -10,9 +10,7 @@ while ( ($file = shift(@ARGV)) ) {
$printed_header = 0; $printed_header = 0;
$file =~ s,.*/,,; $file =~ s,.*/,,;
while (<FILE>) { while (<FILE>) {
if ( /DECLSPEC.*\s\**([^\s\(]+)\(/ ) { if ( /DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
print "\t$1\n";
} elsif ( /DECLSPEC.*\s\**([^\s\(]+)$/ ) {
print "\t$1\n"; print "\t$1\n";
} }
} }
......
...@@ -10,9 +10,7 @@ while ( ($file = shift(@ARGV)) ) { ...@@ -10,9 +10,7 @@ while ( ($file = shift(@ARGV)) ) {
$printed_header = 0; $printed_header = 0;
$file =~ s,.*/,,; $file =~ s,.*/,,;
while (<FILE>) { while (<FILE>) {
if ( /DECLSPEC.*\s\**([^\s\(]+)\(/ ) { if ( /DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
print "\t_$1\n";
} elsif ( /DECLSPEC.*\s\**([^\s\(]+)$/ ) {
print "\t_$1\n"; print "\t_$1\n";
} }
} }
......
...@@ -10,9 +10,7 @@ while ( ($file = shift(@ARGV)) ) { ...@@ -10,9 +10,7 @@ while ( ($file = shift(@ARGV)) ) {
$printed_header = 0; $printed_header = 0;
$file =~ s,.*/,,; $file =~ s,.*/,,;
while (<FILE>) { while (<FILE>) {
if ( /DECLSPEC.*\s\**([^\s\(]+)\(/ ) { if ( /DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
print "\t$1\n";
} elsif ( /DECLSPEC.*\s\**([^\s\(]+)$/ ) {
print "\t$1\n"; print "\t$1\n";
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment