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/
|
|
|
|
|
|
|
|
/// @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"
|
2012-08-19 23:05:38 +02:00
|
|
|
#include "git_version.h"
|
2011-07-28 00:52:37 +02:00
|
|
|
|
2012-08-19 23:33:50 +02:00
|
|
|
#ifdef _DEBUG
|
|
|
|
#define DEBUG_SUFFIX " [DEBUG VERSION]"
|
2007-05-08 02:06:39 +02:00
|
|
|
#else
|
2012-08-19 23:33:50 +02:00
|
|
|
#define DEBUG_SUFFIX ""
|
|
|
|
#endif
|
2012-08-19 23:05:38 +02:00
|
|
|
|
2012-08-19 23:33:50 +02:00
|
|
|
#if defined(BUILD_CREDIT) && !TAGGED_RELEASE
|
|
|
|
#define BUILD_CREDIT_SUFFIX ", " BUILD_CREDIT
|
|
|
|
#else
|
|
|
|
#define BUILD_CREDIT_SUFFIX ""
|
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() {
|
2012-08-19 23:33:50 +02:00
|
|
|
return BUILD_GIT_VERSION_STRING BUILD_CREDIT_SUFFIX DEBUG_SUFFIX;
|
2006-05-07 14:38:33 +02:00
|
|
|
}
|
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
const char *GetAegisubShortVersionString() {
|
2012-08-19 23:33:50 +02:00
|
|
|
return BUILD_GIT_VERSION_STRING DEBUG_SUFFIX;
|
2006-05-07 14:38:33 +02:00
|
|
|
}
|
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
const char *GetAegisubBuildTime() {
|
2012-08-19 23:05:38 +02:00
|
|
|
return __DATE__ " " __TIME__;
|
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
|
|
|
return false;
|
2007-01-07 23:54:04 +01:00
|
|
|
}
|
|
|
|
|
2011-07-28 00:52:37 +02:00
|
|
|
const char *GetVersionNumber() {
|
2012-08-19 23:33:50 +02:00
|
|
|
return BUILD_GIT_VERSION_STRING;
|
2007-01-07 23:54:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int GetSVNRevision() {
|
2012-08-19 23:05:38 +02:00
|
|
|
#ifdef BUILD_GIT_VERSION_NUMBER
|
|
|
|
return BUILD_GIT_VERSION_NUMBER;
|
2011-07-28 00:52:37 +02:00
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
2007-01-07 23:54:04 +01:00
|
|
|
}
|
2012-08-19 23:05:38 +02:00
|
|
|
|