git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8213 c06c8d41-db1a-0410-9941-cceddc491573
7OEQPUSDZ3CTUQYZLALUI7PHZOUBL2TTOKRJBCVEYTL5J2LQUNRQC
// Returns the largest SVN revision number that a source file has been updated
// to. This is not perfectly accurate, but should be good enough for save
// files, as breaking a save almost always involves changing a source file.
int svn_revision();
class check_revision
{
public:
check_revision(int rev);
static int max_rev;
};
// This macro is meant to be used once per source file, e.g. "REVISION($Rev$);"
// It can't be put in header files, as there's no way to generate a unique
// object name across includes. Blame the lack of cross-platform __COUNTER__.
//#define REVISION(rev) static check_revision check_this_source_file_revision(rev)
#define REVISION(rev)
/*
* File: version.cc
* Summary: Version (and revision) functionality.
* Written by: Enne Walker
*
* Modified for Crawl Reference by $Author$ on $Date$
*/
#include "AppHdr.h"
#include "version.h"
REVISION("$Rev$")
int check_revision::max_rev = 0;
check_revision::check_revision(int rev)
{
max_rev = std::max(rev, max_rev);
}
int svn_revision()
{
return check_revision::max_rev;
}