2006-05-07 14:38:33 +02:00
|
|
|
// Copyright (c) 2005, Niels Martin Hansen
|
2006-03-26 23:16:08 +02:00
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
|
|
// and/or other materials provided with the distribution.
|
|
|
|
// * Neither the name of the Aegisub Group nor the names of its contributors
|
|
|
|
// may be used to endorse or promote products derived from this software
|
|
|
|
// without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
// POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2006-03-26 23:16:08 +02:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file version.cpp
|
|
|
|
/// @brief Derive and return various information about the build and version at runtime
|
|
|
|
/// @ingroup main
|
|
|
|
///
|
2006-03-26 23:16:08 +02:00
|
|
|
|
2009-01-04 07:31:48 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2006-03-26 23:16:08 +02:00
|
|
|
#include "version.h"
|
|
|
|
|
2008-01-10 22:27:53 +01:00
|
|
|
#ifdef __WINDOWS__
|
|
|
|
#include "../build/svn-revision.h"
|
2006-05-07 16:29:45 +02:00
|
|
|
#endif
|
2008-03-26 00:43:28 +01:00
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
#define STR_INT2(x) #x
|
|
|
|
#define STR_INT(x) STR_INT2(x)
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
#ifdef _DEBUG
|
|
|
|
#define DEBUG_SUFFIX " [DEBUG VERSION]"
|
2007-05-08 02:06:39 +02:00
|
|
|
#else
|
2011-07-28 00:52:37 +02:00
|
|
|
#define DEBUG_SUFFIX ""
|
2007-05-08 02:06:39 +02:00
|
|
|
#endif
|
2009-06-16 21:11:08 +02:00
|
|
|
|
2007-09-12 01:22:26 +02:00
|
|
|
#ifdef BUILD_CREDIT
|
2011-07-28 00:52:37 +02:00
|
|
|
#define BUILD_CREDIT_SUFFIX ", " BUILD_CREDIT
|
2007-09-12 01:22:26 +02:00
|
|
|
#else
|
2011-07-28 00:52:37 +02:00
|
|
|
#define BUILD_CREDIT_SUFFIX ""
|
2007-09-12 01:22:26 +02:00
|
|
|
#endif
|
2006-05-07 14:38:33 +02:00
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
#ifndef BUILD_SVN_DATE
|
|
|
|
#define BUILD_SVN_DATE __DATE__ " " __TIME__
|
2006-05-07 16:29:45 +02:00
|
|
|
#endif
|
2006-05-07 14:38:33 +02:00
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
#ifndef BUILD_SVN_LOCALMODS
|
|
|
|
#define BUILD_SVN_LOCALMODS ""
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Define FINAL_RELEASE to mark a build as a "final" version, ie. not pre-release version
|
|
|
|
// In that case it won't include the SVN revision information
|
2007-05-08 02:06:39 +02:00
|
|
|
#ifdef FINAL_RELEASE
|
2011-07-28 00:52:37 +02:00
|
|
|
#define VERSION_NUMBER "3.0.0"
|
2007-05-08 02:06:39 +02:00
|
|
|
#else
|
2011-07-28 00:52:37 +02:00
|
|
|
#define VERSION_NUMBER "r" STR_INT(BUILD_SVN_REVISION) BUILD_SVN_LOCALMODS
|
2007-05-08 02:06:39 +02:00
|
|
|
#endif
|
2006-05-07 14:38:33 +02:00
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
const char *GetAegisubLongVersionString() {
|
|
|
|
#ifdef FINAL_RELEASE
|
|
|
|
return VERSION_NUMBER DEBUG_SUFFIX;
|
|
|
|
#else
|
|
|
|
return VERSION_NUMBER " (development version" BUILD_CREDIT_SUFFIX ")" DEBUG_SUFFIX;
|
2009-01-01 14:16:42 +01:00
|
|
|
#endif
|
2006-05-07 14:38:33 +02:00
|
|
|
}
|
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
const char *GetAegisubShortVersionString() {
|
|
|
|
#ifdef FINAL_RELEASE
|
|
|
|
return VERSION_NUMBER " (built from SVN revision r" #BUILD_SVN_REVISION BUILD_SVN_LOCALMODS ")" DEBUG_SUFFIX;
|
|
|
|
#else
|
|
|
|
return VERSION_NUMBER " (development version" BUILD_CREDIT_SUFFIX ")" DEBUG_SUFFIX;
|
|
|
|
#endif
|
2006-05-07 14:38:33 +02:00
|
|
|
}
|
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
const char *GetAegisubBuildTime() {
|
|
|
|
return BUILD_SVN_DATE;
|
2006-05-07 14:38:33 +02:00
|
|
|
}
|
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
const char *GetAegisubBuildCredit() {
|
|
|
|
#ifdef BUILD_CREDIT
|
|
|
|
return BUILD_CREDIT;
|
|
|
|
#else
|
|
|
|
return "";
|
|
|
|
#endif
|
2006-03-26 23:16:08 +02:00
|
|
|
}
|
2007-01-07 23:54:04 +01:00
|
|
|
|
|
|
|
bool GetIsOfficialRelease() {
|
2011-07-28 00:52:37 +02:00
|
|
|
#ifdef FINAL_RELEASE
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
return false;
|
|
|
|
#endif
|
2007-01-07 23:54:04 +01:00
|
|
|
}
|
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
const char *GetVersionNumber() {
|
|
|
|
return VERSION_NUMBER;
|
2007-01-07 23:54:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int GetSVNRevision() {
|
2011-07-28 00:52:37 +02:00
|
|
|
#ifdef BUILD_SVN_REVISION
|
|
|
|
return BUILD_SVN_REVISION;
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
2007-01-07 23:54:04 +01:00
|
|
|
}
|