Changed revision details to be a string (an hg changeset) instead of an int.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 28 Feb 2010 02:07:40 -0500
changeset 44195e7e1f1a4056
parent 4418 be1929ccaa3d
child 4421 2e140f18aba7
Changed revision details to be a string (an hg changeset) instead of an int.
build-scripts/showrev.sh
build-scripts/updaterev.sh
include/SDL_version.h
src/SDL.c
test/testver.c
     1.1 --- a/build-scripts/showrev.sh	Sun Feb 28 02:06:47 2010 -0500
     1.2 +++ b/build-scripts/showrev.sh	Sun Feb 28 02:07:40 2010 -0500
     1.3 @@ -2,14 +2,7 @@
     1.4  #
     1.5  # Print the current source revision, if available
     1.6  
     1.7 -srcdir=`dirname $0`/..
     1.8 +# FIXME: this prints the tip, which isn't useful if you're on a different
     1.9 +#  branch, or just not sync'd to the tip.
    1.10 +hg tip --template 'hg-{rev}:{node|short}'
    1.11  
    1.12 -if [ -d $srcdir/.svn ]; then
    1.13 -    cd $srcdir
    1.14 -    (svnversion -c 2>/dev/null || svnversion .) | \
    1.15 -        sed -e 's,\([0-9]*\)[A-Z]*,\1,' \
    1.16 -            -e 's,[0-9]*:\([0-9]*\)[A-Z]*,\1,'
    1.17 -else
    1.18 -     cd $srcdir
    1.19 -     git svn info | grep Revision | awk '{ print $2 }'
    1.20 -fi
     2.1 --- a/build-scripts/updaterev.sh	Sun Feb 28 02:06:47 2010 -0500
     2.2 +++ b/build-scripts/updaterev.sh	Sun Feb 28 02:07:40 2010 -0500
     2.3 @@ -8,7 +8,7 @@
     2.4  
     2.5  rev=`sh showrev.sh`
     2.6  if [ "$rev" != "" ]; then
     2.7 -    echo "#define SDL_REVISION $rev" >$header.new
     2.8 +    echo "#define SDL_REVISION \"$rev\"" >$header.new
     2.9      if diff $header $header.new >/dev/null 2>&1; then
    2.10          rm $header.new
    2.11      else
     3.1 --- a/include/SDL_version.h	Sun Feb 28 02:06:47 2010 -0500
     3.2 +++ b/include/SDL_version.h	Sun Feb 28 02:07:40 2010 -0500
     3.3 @@ -139,8 +139,11 @@
     3.4  
     3.5  /**
     3.6   *  \brief Get the code revision of SDL that is linked against your program.
     3.7 + *
     3.8 + *  This is an arbitrary string (a hash value, actually), and is only useful
     3.9 + *  in comparing against other revisions. It is NOT an incrementing number.
    3.10   */
    3.11 -extern DECLSPEC int SDLCALL SDL_GetRevision(void);
    3.12 +extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
    3.13  
    3.14  /* Ends C function definitions when using C++ */
    3.15  #ifdef __cplusplus
     4.1 --- a/src/SDL.c	Sun Feb 28 02:06:47 2010 -0500
     4.2 +++ b/src/SDL.c	Sun Feb 28 02:07:40 2010 -0500
     4.3 @@ -271,7 +271,7 @@
     4.4  }
     4.5  
     4.6  /* Get the library source revision */
     4.7 -int
     4.8 +const char *
     4.9  SDL_GetRevision(void)
    4.10  {
    4.11      return SDL_REVISION;
     5.1 --- a/test/testver.c	Sun Feb 28 02:06:47 2010 -0500
     5.2 +++ b/test/testver.c	Sun Feb 28 02:07:40 2010 -0500
     5.3 @@ -20,10 +20,10 @@
     5.4      printf("Compiled with SDL older than 1.3\n");
     5.5  #endif
     5.6      SDL_VERSION(&compiled);
     5.7 -    printf("Compiled version: %d.%d.%d-%d\n",
     5.8 +    printf("Compiled version: %d.%d.%d (%s)\n",
     5.9             compiled.major, compiled.minor, compiled.patch, SDL_REVISION);
    5.10      SDL_GetVersion(&linked);
    5.11 -    printf("Linked version: %d.%d.%d-%d\n",
    5.12 +    printf("Linked version: %d.%d.%d (%s)\n",
    5.13             linked.major, linked.minor, linked.patch, SDL_GetRevision());
    5.14      SDL_Quit();
    5.15      return (0);