diff --git a/desmume/configure.ac b/desmume/configure.ac index 7b12d3bcf..2663a4472 100644 --- a/desmume/configure.ac +++ b/desmume/configure.ac @@ -24,15 +24,16 @@ AC_PROG_RANLIB dnl -- check for endianess AC_C_BIGENDIAN -dnl -- since svn 1.7 theres only a single .svn folder in the root dir -REVISION="r0" +dnl -- since svn 1.7 theres only a single .svn folder in the root dir of the checkout +dnl -- depending on what was checked out that might be .svn or ../.svn +REVISION=0 SVN=`which svn 2>/dev/null` -if test -d "../.svn" -a "x${SVN}" != "x" -a -x "${SVN}" ; then - REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4` +if ( test -d .svn || test -d ../.svn ; ) && test "x${SVN}" != "x" -a -x "${SVN}" ; then + REVISION=`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4` echo "$REVISION" fi -AC_DEFINE_UNQUOTED([SVN_REV], "$REVISION", [subversion revision number]) - +AC_DEFINE_UNQUOTED([SVN_REV], [$REVISION], [subversion revision number]) +AC_DEFINE_UNQUOTED([SVN_REV_STR], ["$REVISION"], [subversion revision number string]) dnl - Check for intltool/gettext macros IT_PROG_INTLTOOL diff --git a/desmume/src/saves.cpp b/desmume/src/saves.cpp index c5d339c58..8b0266efd 100644 --- a/desmume/src/saves.cpp +++ b/desmume/src/saves.cpp @@ -47,7 +47,6 @@ #include "path.h" #ifdef HOST_WINDOWS -#include "svnrev.h" #include "windows/main.h" #endif @@ -58,13 +57,7 @@ int lastSaveState = 0; //Keeps track of last savestate used for quick save/load #define SS_INDIRECT 0x80000000 u32 _DESMUME_version = EMU_DESMUME_VERSION_NUMERIC(); -#ifdef SVN_REV -#define _SVN_REV SVN_REV -#else -#define _SVN_REV 0 -#endif - -u32 svn_rev = _SVN_REV; +u32 svn_rev = EMU_DESMUME_SUBVERSION_NUMERIC(); s64 save_time = 0; savestates_t savestates[NB_STATES]; @@ -1025,11 +1018,7 @@ bool savestate_save (const char *file_name) static void writechunks(EMUFILE* os) { DateTime tm = DateTime::get_Now(); -#ifdef PUBLIC_RELEASE - svn_rev = 0xFFFFFFFF; -#else - svn_rev = _SVN_REV; -#endif + svn_rev = EMU_DESMUME_SUBVERSION_NUMERIC(); save_time = tm.get_Ticks(); diff --git a/desmume/src/version.cpp b/desmume/src/version.cpp index a24e92c5a..13b8975b8 100644 --- a/desmume/src/version.cpp +++ b/desmume/src/version.cpp @@ -35,10 +35,9 @@ #if defined(HOST_WINDOWS) || defined(DESMUME_COCOA) #include "svnrev.h" #else - #ifdef SVN_REV - #define SVN_REV_STR SVN_REV - #else - #define SVN_REV_STR "" + #ifndef SVN_REV + #define SVN_REV 0 + #define SVN_REV_STR "0" #endif #endif @@ -115,6 +114,12 @@ #define DESMUME_JIT "" #endif +#ifdef PUBLIC_RELEASE +const u32 DESMUME_SUBVERSION_NUMERIC = 0xFFFFFFFF; +#else +const u32 DESMUME_SUBVERSION_NUMERIC = SVN_REV; +#endif + const u8 DESMUME_VERSION_MAJOR = 0; const u8 DESMUME_VERSION_MINOR = 9; const u8 DESMUME_VERSION_BUILD = 10; @@ -124,6 +129,7 @@ const u8 DESMUME_VERSION_BUILD = 10; #define DESMUME_NAME_AND_VERSION DESMUME_NAME DESMUME_VERSION_STRING u32 EMU_DESMUME_VERSION_NUMERIC() { return DESMUME_VERSION_NUMERIC; } +u32 EMU_DESMUME_SUBVERSION_NUMERIC() { return DESMUME_SUBVERSION_NUMERIC; } const char* EMU_DESMUME_VERSION_STRING() { return DESMUME_VERSION_STRING; } const char* EMU_DESMUME_SUBVERSION_STRING() { return DESMUME_SUBVERSION_STRING; } const char* EMU_DESMUME_NAME_AND_VERSION() { return DESMUME_NAME_AND_VERSION; } diff --git a/desmume/src/version.h b/desmume/src/version.h index 3c3608211..692be7cdf 100644 --- a/desmume/src/version.h +++ b/desmume/src/version.h @@ -23,6 +23,7 @@ extern const u8 DESMUME_VERSION_MINOR; extern const u8 DESMUME_VERSION_BUILD; u32 EMU_DESMUME_VERSION_NUMERIC(); +u32 EMU_DESMUME_SUBVERSION_NUMERIC(); const char* EMU_DESMUME_VERSION_STRING(); const char* EMU_DESMUME_SUBVERSION_STRING(); const char* EMU_DESMUME_NAME_AND_VERSION();