Deprecate SDL_GetRevisionNumber and update things for git instead of hg.

Fixes #4063
This commit is contained in:
Ryan C. Gordon 2021-02-12 14:15:29 -05:00
parent ee25a1e6e2
commit 4ff51d29c3
11 changed files with 21 additions and 24 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
find . -type f -exec grep -Il "Copyright" {} \; \
| grep -v \.hg \
| grep -v \.git \
| while read file; \
do \
LC_ALL=C sed -b -i "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$file"; \

4
configure vendored
View File

@ -16000,9 +16000,9 @@ esac
if test x$srcdir != x.; then
INCLUDE="-Iinclude $INCLUDE"
elif test -d .hg; then
elif test -d .git; then
as_fn_error $? "
*** When building from Mercurial you should configure and build in a
*** When building from a git clone you should configure and build in a
separate directory so you don't clobber SDL_config.h, SDL_revision.h
" "$LINENO" 5
fi

View File

@ -82,9 +82,9 @@ esac
if test x$srcdir != x.; then
INCLUDE="-Iinclude $INCLUDE"
elif test -d .hg; then
elif test -d .git; then
AC_MSG_ERROR([
*** When building from Mercurial you should configure and build in a
*** When building from a git clone you should configure and build in a
separate directory so you don't clobber SDL_config.h, SDL_revision.h
])
fi

View File

@ -1,6 +1,4 @@
We are no longer hosted in Mercurial. The official repo is now:
https://github.com/libsdl-org/SDL
We are no longer hosted in Mercurial. Please see README-git.md for details.
Thanks!

View File

@ -15,7 +15,7 @@ Build Dependencies
Ubuntu 20.04, all available features enabled:
sudo apt-get install build-essential mercurial make cmake autoconf automake \
sudo apt-get install build-essential git make cmake autoconf automake \
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
libxss-dev libgl1-mesa-dev libdbus-1-dev libudev-dev libgles2-mesa-dev \

View File

@ -35,7 +35,7 @@ More documentation and FAQs are available online at [the wiki](http://wiki.libsd
- [DynAPI](README-dynapi.md)
- [Emscripten](README-emscripten.md)
- [Gesture](README-gesture.md)
- [Mercurial](README-hg.md)
- [Git](README-git.md)
- [iOS](README-ios.md)
- [Linux](README-linux.md)
- [OS X](README-macosx.md)

View File

@ -142,13 +142,15 @@ extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
/**
* \brief Get the revision number of SDL that is linked against your program.
* \brief Obsolete function, do not use.
*
* Returns a number uniquely identifying the exact revision of the SDL
* library in use. It is an incrementing number based on commits to
* hg.libsdl.org.
* 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.
*/
extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
/* Ends C function definitions when using C++ */

View File

@ -468,7 +468,7 @@ SDL_GetRevision(void)
int
SDL_GetRevisionNumber(void)
{
return SDL_REVISION_NUMBER;
return 0; /* doesn't make sense without Mercurial. */
}
/* Get the name of the platform */

View File

@ -21,7 +21,7 @@
# WHAT IS THIS?
# When you add a public API to SDL, please run this script, make sure the
# output looks sane (hg diff, it adds to existing files), and commit it.
# output looks sane (git diff, it adds to existing files), and commit it.
# It keeps the dynamic API jump table operating correctly.
# If you wanted this to be readable, you shouldn't have used perl.

View File

@ -141,9 +141,6 @@ int platform_testGetFunctions (void *arg)
SDLTest_AssertPass("SDL_GetRevision()");
SDLTest_AssertCheck(revision != NULL, "SDL_GetRevision() != NULL");
ret = SDL_GetRevisionNumber();
SDLTest_AssertPass("SDL_GetRevisionNumber()");
return TEST_COMPLETED;
}

View File

@ -35,13 +35,13 @@ main(int argc, char *argv[])
SDL_Log("Compiled with SDL older than 2.0\n");
#endif
SDL_VERSION(&compiled);
SDL_Log("Compiled version: %d.%d.%d.%d (%s)\n",
SDL_Log("Compiled version: %d.%d.%d (%s)\n",
compiled.major, compiled.minor, compiled.patch,
SDL_REVISION_NUMBER, SDL_REVISION);
SDL_REVISION);
SDL_GetVersion(&linked);
SDL_Log("Linked version: %d.%d.%d.%d (%s)\n",
SDL_Log("Linked version: %d.%d.%d (%s)\n",
linked.major, linked.minor, linked.patch,
SDL_GetRevisionNumber(), SDL_GetRevision());
SDL_GetRevision());
SDL_Quit();
return (0);
}