Date: Fri, 20 Aug 2004 08:31:20 +0200
authorSam Lantinga <slouken@libsdl.org>
Fri, 20 Aug 2004 18:57:01 +0000
changeset 93002759105b989
parent 929 03fb90fc135e
child 931 abe872771687
Date: Fri, 20 Aug 2004 08:31:20 +0200
From: "Markus F.X.J. Oberhumer"
Subject: [SDL-CVS][patch] add missing SDLCALL to headers

the small patch attached below (against current CVS) adds some missing SDLCALL
decorations to callback types and arguments.

Unfortunately one of these changes breaks your gen{def,exp}.pl scripts which
should be changed to use non-greedy regular expression matching...
include/SDL_audio.h
include/SDL_events.h
include/SDL_rwops.h
include/SDL_thread.h
src/main/beos/exports/genexp.pl
src/main/macos/exports/gendef.pl
src/main/macosx/exports/gendef.pl
src/main/win32/exports/gendef.pl
     1.1 --- a/include/SDL_audio.h	Wed Aug 18 21:41:39 2004 +0000
     1.2 +++ b/include/SDL_audio.h	Fri Aug 20 18:57:01 2004 +0000
     1.3 @@ -59,7 +59,7 @@
     1.4  	   Once the callback returns, the buffer will no longer be valid.
     1.5  	   Stereo samples are stored in a LRLRLR ordering.
     1.6  	*/
     1.7 -	void (*callback)(void *userdata, Uint8 *stream, int len);
     1.8 +	void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len);
     1.9  	void  *userdata;
    1.10  } SDL_AudioSpec;
    1.11  
    1.12 @@ -94,7 +94,7 @@
    1.13  	int    len_cvt;			/* Length of converted audio buffer */
    1.14  	int    len_mult;		/* buffer must be len*len_mult big */
    1.15  	double len_ratio; 	/* Given len, final size is len*len_ratio */
    1.16 -	void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
    1.17 +	void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
    1.18  	int filter_index;		/* Current audio conversion function */
    1.19  } SDL_AudioCVT;
    1.20  
     2.1 --- a/include/SDL_events.h	Wed Aug 18 21:41:39 2004 +0000
     2.2 +++ b/include/SDL_events.h	Fri Aug 20 18:57:01 2004 +0000
     2.3 @@ -285,7 +285,7 @@
     2.4  
     2.5    The filter is protypted as:
     2.6  */
     2.7 -typedef int (*SDL_EventFilter)(const SDL_Event *event);
     2.8 +typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event);
     2.9  /*
    2.10    If the filter returns 1, then the event will be added to the internal queue.
    2.11    If it returns 0, then the event will be dropped from the queue, but the 
     3.1 --- a/include/SDL_rwops.h	Wed Aug 18 21:41:39 2004 +0000
     3.2 +++ b/include/SDL_rwops.h	Fri Aug 20 18:57:01 2004 +0000
     3.3 @@ -49,22 +49,22 @@
     3.4  		SEEK_SET, SEEK_CUR, SEEK_END
     3.5  	   Returns the final offset in the data source.
     3.6  	 */
     3.7 -	int (*seek)(struct SDL_RWops *context, int offset, int whence);
     3.8 +	int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence);
     3.9  
    3.10  	/* Read up to 'num' objects each of size 'objsize' from the data
    3.11  	   source to the area pointed at by 'ptr'.
    3.12  	   Returns the number of objects read, or -1 if the read failed.
    3.13  	 */
    3.14 -	int (*read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
    3.15 +	int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum);
    3.16  
    3.17  	/* Write exactly 'num' objects each of size 'objsize' from the area
    3.18  	   pointed at by 'ptr' to data source.
    3.19  	   Returns 'num', or -1 if the write failed.
    3.20  	 */
    3.21 -	int (*write)(struct SDL_RWops *context, const void *ptr, int size, int num);
    3.22 +	int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num);
    3.23  
    3.24  	/* Close and free an allocated SDL_FSops structure */
    3.25 -	int (*close)(struct SDL_RWops *context);
    3.26 +	int (SDLCALL *close)(struct SDL_RWops *context);
    3.27  
    3.28  	Uint32 type;
    3.29  	union {
     4.1 --- a/include/SDL_thread.h	Wed Aug 18 21:41:39 2004 +0000
     4.2 +++ b/include/SDL_thread.h	Fri Aug 20 18:57:01 2004 +0000
     4.3 @@ -50,7 +50,7 @@
     4.4  typedef struct SDL_Thread SDL_Thread;
     4.5  
     4.6  /* Create a thread */
     4.7 -extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (*fn)(void *), void *data);
     4.8 +extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data);
     4.9  
    4.10  /* Get the 32-bit thread identifier for the current thread */
    4.11  extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void);
     5.1 --- a/src/main/beos/exports/genexp.pl	Wed Aug 18 21:41:39 2004 +0000
     5.2 +++ b/src/main/beos/exports/genexp.pl	Fri Aug 20 18:57:01 2004 +0000
     5.3 @@ -9,7 +9,7 @@
     5.4  	}
     5.5  	$file =~ s,.*/,,;
     5.6  	while (<FILE>) {
     5.7 -		if ( / DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
     5.8 +		if ( / DECLSPEC.* SDLCALL ([^\s\(]+)/ ) {
     5.9  			print "_$1\n";
    5.10  		}
    5.11  	}
     6.1 --- a/src/main/macos/exports/gendef.pl	Wed Aug 18 21:41:39 2004 +0000
     6.2 +++ b/src/main/macos/exports/gendef.pl	Fri Aug 20 18:57:01 2004 +0000
     6.3 @@ -10,7 +10,7 @@
     6.4  	$printed_header = 0;
     6.5  	$file =~ s,.*/,,;
     6.6  	while (<FILE>) {
     6.7 -		if ( / DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
     6.8 +		if ( / DECLSPEC.* SDLCALL ([^\s\(]+)/ ) {
     6.9  			print "\t$1\n";
    6.10  		}
    6.11  	}
     7.1 --- a/src/main/macosx/exports/gendef.pl	Wed Aug 18 21:41:39 2004 +0000
     7.2 +++ b/src/main/macosx/exports/gendef.pl	Fri Aug 20 18:57:01 2004 +0000
     7.3 @@ -14,7 +14,7 @@
     7.4  	$printed_header = 0;
     7.5  	$file =~ s,.*/,,;
     7.6  	while (<FILE>) {
     7.7 -		if ( / DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
     7.8 +		if ( / DECLSPEC.* SDLCALL ([^\s\(]+)/ ) {
     7.9  			print "\t_$1\n";
    7.10  		}
    7.11  	}
     8.1 --- a/src/main/win32/exports/gendef.pl	Wed Aug 18 21:41:39 2004 +0000
     8.2 +++ b/src/main/win32/exports/gendef.pl	Fri Aug 20 18:57:01 2004 +0000
     8.3 @@ -10,7 +10,7 @@
     8.4  	$printed_header = 0;
     8.5  	$file =~ s,.*/,,;
     8.6  	while (<FILE>) {
     8.7 -		if ( / DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
     8.8 +		if ( / DECLSPEC.* SDLCALL ([^\s\(]+)/ ) {
     8.9  			print "\t$1\n";
    8.10  		}
    8.11  	}