SDL: Removed SDL_GetRevisionNumber()

From 346eeba2104ea23a033b5929171409e9b78fc975 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 25 Nov 2022 13:36:14 -0800
Subject: [PATCH] Removed SDL_GetRevisionNumber()

 WhatsNew.txt                      |  9 ++++++++-
 docs/          | 10 ++++++++++
 include/SDL_version.h             | 23 -----------------------
 src/SDL.c                         |  7 -------
 src/dynapi/SDL_dynapi_overrides.h |  1 -
 src/dynapi/SDL_dynapi_procs.h     |  1 -
 test/testautomation_platform.c    |  1 -
 7 files changed, 18 insertions(+), 34 deletions(-)

diff --git a/WhatsNew.txt b/WhatsNew.txt
index dabef2fbf8a7..c740f8ec660e 100644
--- a/WhatsNew.txt
+++ b/WhatsNew.txt
@@ -8,4 +8,11 @@ This is a list of major changes in SDL's version history.
 * 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()
diff --git a/docs/ b/docs/
index 53939780e766..524da783ce39 100644
--- a/docs/
+++ b/docs/
@@ -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.
@@ -121,10 +123,12 @@ SDL_RWFromFP(void *fp, SDL_bool autoclose)


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.


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:
@@ -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_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.
diff --git a/include/SDL_version.h b/include/SDL_version.h
index 6f86ab756108…69753e6b76b8 100644
— a/include/SDL_version.h
+++ b/include/SDL_version.h
@@ -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
diff --git a/src/SDL.c b/src/SDL.c
index 90bf7a2cb4f6…e77451e4b9e0 100644
— a/src/SDL.c
+++ b/src/SDL.c
@@ -520,13 +520,6 @@ SDL_GetRevision(void)

-/* Get the library source revision number */

  • return 0; /* doesn’t make sense without Mercurial. */

/* Get the name of the platform /
const char *
diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h
index 4060c1755c2c…50e8ec99e68c 100644
— a/src/dynapi/SDL_dynapi_overrides.h
+++ b/src/dynapi/SDL_dynapi_overrides.h
@@ -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
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index d34d3d7840f4…96d1e8d441ca 100644
— a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -514,7 +514,6 @@ SDL_DYNAPI_PROC(int,SDL_GetNumTouchFingers,(SDL_TouchID a),(a),return)
,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_DYNAPI_PROC(const char*,SDL_GetVideoDriver,(int a),(a),return)
SDL_DYNAPI_PROC(int,SDL_VideoInit,(const char *a),(a),return)
diff --git a/test/testautomation_platform.c b/test/testautomation_platform.c
index e8661488481a…dfbfbc756997 100644
— a/test/testautomation_platform.c
+++ b/test/testautomation_platform.c
@@ -124,7 +124,6 @@ int platform_testEndianessAndSwap(void *arg)