Skip to content

Commit

Permalink
Removed SDL_GetRevisionNumber()
Browse files Browse the repository at this point in the history
Fixes #6620
  • Loading branch information
slouken committed Nov 25, 2022
1 parent ac8fbb7 commit 346eeba
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 34 deletions.
9 changes: 8 additions & 1 deletion WhatsNew.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ This is a list of major changes in SDL's version history.
General:
* M_PI is no longer defined in SDL_stdinc.h, now the symbols SDL_PI_D (double) and SDL_PI_F (float) are available
* SDL_GetWindowWMInfo() returns a standard int result code instead of SDL_bool, and takes SDL_SYSWM_CURRENT_VERSION as a new third parameter
* SDL_RWFromFP has been removed from the API
* Removed the following functions from the API:
* SDL_CalculateGammaRamp()
* SDL_GetRevisionNumber()
* SDL_GetWindowBrightness()
* SDL_GetWindowGammaRamp()
* SDL_RWFromFP()
* SDL_SetWindowBrightness()
* SDL_SetWindowGammaRamp()
10 changes: 10 additions & 0 deletions docs/README-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ This guide provides useful information for migrating applications from SDL 2.0 t

We have provided a handy Python script to automate some of this work for you [link to script], and details on the changes are organized by SDL 2.0 header below.


## SDL_pixels.h

SDL_CalculateGammaRamp has been removed, because SDL_SetWindowGammaRamp has been removed as well due to poor support in modern operating systems (see [SDL_video.h](#sdl_videoh)).


## SDL_rwops.h

SDL_RWFromFP has been removed from the API, due to issues when the SDL library uses a different C runtime from the application.
Expand Down Expand Up @@ -121,10 +123,12 @@ SDL_RWFromFP(void *fp, SDL_bool autoclose)
}
```
## SDL_stdinc.h
M_PI is no longer defined in SDL_stdinc.h, you can use the new symbols SDL_PI_D (double) and SDL_PI_F (float) instead.
## SDL_syswm.h
This header no longer includes platform specific headers and type definitions, instead allowing you to include the ones appropriate for your use case. You should define one or more of the following to enable the relevant platform-specific support:
Expand All @@ -143,6 +147,12 @@ The structures in this file are versioned separately from the rest of SDL, allow
This function now returns a standard int result instead of SDL_bool, returning 0 if the function succeeds or a negative error code if there was an error. You should also pass `SDL_SYSWM_CURRENT_VERSION` as the new third version parameter. The version member of the info structure will be filled in with the version of data that is returned, the minimum of the version you requested and the version supported by the runtime SDL library.
## SDL_version.h
SDL_GetRevisionNumber() has been removed from the API, it always returned 0 in SDL 2.0
## SDL_video.h
SDL_SetWindowBrightness and SDL_SetWindowGammaRamp have been removed from the API, because they interact poorly with modern operating systems and aren't able to limit their effects to the SDL window.
Expand Down
23 changes: 0 additions & 23 deletions include/SDL_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,6 @@ extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
*/
extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);

/**
* Obsolete function, do not use.
*
* When SDL was hosted in a Mercurial repository, and was built carefully,
* this would return the revision number that the build was created from. This
* number was not reliable for several reasons, but more importantly, SDL is
* now hosted in a git repository, which does not offer numbers at all, only
* hashes. This function only ever returns zero now. Don't use it.
*
* Before SDL 2.0.16, this might have returned an unreliable, but non-zero
* number.
*
* \deprecated Use SDL_GetRevision() instead; if SDL was carefully built, it
* will return a git hash.
*
* \returns zero, always, in modern SDL releases.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetRevision
*/
extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);


/* Ends C function definitions when using C++ */
#ifdef __cplusplus
Expand Down
7 changes: 0 additions & 7 deletions src/SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,13 +520,6 @@ SDL_GetRevision(void)
return SDL_REVISION;
}

/* Get the library source revision number */
int
SDL_GetRevisionNumber(void)
{
return 0; /* doesn't make sense without Mercurial. */
}

/* Get the name of the platform */
const char *
SDL_GetPlatform(void)
Expand Down
1 change: 0 additions & 1 deletion src/dynapi/SDL_dynapi_overrides.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@
#define SDL_GetTouchFinger SDL_GetTouchFinger_REAL
#define SDL_GetVersion SDL_GetVersion_REAL
#define SDL_GetRevision SDL_GetRevision_REAL
#define SDL_GetRevisionNumber SDL_GetRevisionNumber_REAL
#define SDL_GetNumVideoDrivers SDL_GetNumVideoDrivers_REAL
#define SDL_GetVideoDriver SDL_GetVideoDriver_REAL
#define SDL_VideoInit SDL_VideoInit_REAL
Expand Down
1 change: 0 additions & 1 deletion src/dynapi/SDL_dynapi_procs.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ SDL_DYNAPI_PROC(int,SDL_GetNumTouchFingers,(SDL_TouchID a),(a),return)
SDL_DYNAPI_PROC(SDL_Finger*,SDL_GetTouchFinger,(SDL_TouchID a, int b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_GetVersion,(SDL_version *a),(a),)
SDL_DYNAPI_PROC(const char*,SDL_GetRevision,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_GetRevisionNumber,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_GetNumVideoDrivers,(void),(),return)
SDL_DYNAPI_PROC(const char*,SDL_GetVideoDriver,(int a),(a),return)
SDL_DYNAPI_PROC(int,SDL_VideoInit,(const char *a),(a),return)
Expand Down
1 change: 0 additions & 1 deletion test/testautomation_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ int platform_testEndianessAndSwap(void *arg)
* http://wiki.libsdl.org/SDL_GetCPUCount
* http://wiki.libsdl.org/SDL_GetCPUCacheLineSize
* http://wiki.libsdl.org/SDL_GetRevision
* http://wiki.libsdl.org/SDL_GetRevisionNumber
*/
int platform_testGetFunctions (void *arg)
{
Expand Down

0 comments on commit 346eeba

Please sign in to comment.