[Scummvm-cvs-logs] SF.net SVN: scummvm:[51978] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Aug 11 14:50:19 CEST 2010


Revision: 51978
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51978&view=rev
Author:   fingolfin
Date:     2010-08-11 12:50:18 +0000 (Wed, 11 Aug 2010)

Log Message:
-----------
BUILD: Limit scope of SCUMMVM_SVN_REVISION and SCUMMVM_VERSION macros

Only #define SCUMMVM_SVN_REVISION for base/version.cpp (at most), to
avoid having all source files implicitly depend on the SVN revision.
Also add a safeguard to prevent code from accidentally using the
internal header file base/internal_version.h.

Modified Paths:
--------------
    scummvm/trunk/Makefile.common
    scummvm/trunk/base/internal_version.h
    scummvm/trunk/base/internal_version.h.in
    scummvm/trunk/base/version.cpp

Modified: scummvm/trunk/Makefile.common
===================================================================
--- scummvm/trunk/Makefile.common	2010-08-11 12:50:00 UTC (rev 51977)
+++ scummvm/trunk/Makefile.common	2010-08-11 12:50:18 UTC (rev 51978)
@@ -172,12 +172,11 @@
 endif
 
 # Define the Subversion revision if available, either autodetected or
-# specified by the user
+# specified by the user, but only for base/version.cpp.
 ifneq ($(origin VER_SVNREV), undefined)
-CXXFLAGS+= -DSCUMMVM_SVN_REVISION=\"$(VER_SVNREV)\"
+base/version.o: CXXFLAGS:=$(CXXFLAGS) -DSCUMMVM_SVN_REVISION=\"$(VER_SVNREV)\"
 endif
 
-
 ######################################################################
 # Distribution settings
 ######################################################################

Modified: scummvm/trunk/base/internal_version.h
===================================================================
--- scummvm/trunk/base/internal_version.h	2010-08-11 12:50:00 UTC (rev 51977)
+++ scummvm/trunk/base/internal_version.h	2010-08-11 12:50:18 UTC (rev 51978)
@@ -1,3 +1,7 @@
+#ifndef INCLUDED_FROM_BASE_VERSION_CPP
+#error This file may only be included by base/version.cpp
+#endif
+
 #ifndef SCUMMVM_SVN_REVISION
 #define SCUMMVM_SVN_REVISION
 #endif

Modified: scummvm/trunk/base/internal_version.h.in
===================================================================
--- scummvm/trunk/base/internal_version.h.in	2010-08-11 12:50:00 UTC (rev 51977)
+++ scummvm/trunk/base/internal_version.h.in	2010-08-11 12:50:18 UTC (rev 51978)
@@ -1,3 +1,7 @@
+#ifndef INCLUDED_FROM_BASE_VERSION_CPP
+#error This file may only be included by base/version.cpp
+#endif
+
 #ifndef SCUMMVM_SVN_REVISION
 #define SCUMMVM_SVN_REVISION
 #endif

Modified: scummvm/trunk/base/version.cpp
===================================================================
--- scummvm/trunk/base/version.cpp	2010-08-11 12:50:00 UTC (rev 51977)
+++ scummvm/trunk/base/version.cpp	2010-08-11 12:50:18 UTC (rev 51978)
@@ -24,9 +24,11 @@
  */
 
 #include "common/scummsys.h"
-#include "base/internal_version.h"
 #include "base/version.h"
 
+#define INCLUDED_FROM_BASE_VERSION_CPP
+#include "base/internal_version.h"
+
 /*
  * Version string and build date string. These can be used by anything that
  * wants to display this information to the user (e.g. about dialog).


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list