Improved compiler detection. Partly borrowed from MPC-HC project.

This commit is contained in:
LoRd_MuldeR 2011-04-07 22:40:47 +02:00
parent 8fb604fc58
commit 5066bd97c0
5 changed files with 53 additions and 15 deletions

View File

@ -25,7 +25,7 @@
#define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 2 #define VER_LAMEXP_MINOR_LO 2
#define VER_LAMEXP_BUILD 421 #define VER_LAMEXP_BUILD 423
#define VER_LAMEXP_SUFFIX Alpha-1 #define VER_LAMEXP_SUFFIX Alpha-1
/* /*

View File

@ -75,14 +75,25 @@ AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstSta
QMessageBox(parent), QMessageBox(parent),
m_settings(settings) m_settings(settings)
{ {
const QString versionStr = QString().sprintf("Version %d.%02d %s, Build %d [%s]", lamexp_version_major(), lamexp_version_minor(), lamexp_version_release(), lamexp_version_build(), lamexp_version_date().toString(Qt::ISODate).toLatin1().constData()); const QString versionStr = QString().sprintf
(
"Version %d.%02d %s, Build %d [%s], %s, Qt v%s",
lamexp_version_major(),
lamexp_version_minor(),
lamexp_version_release(),
lamexp_version_build(),
lamexp_version_date().toString(Qt::ISODate).toLatin1().constData(),
lamexp_version_compiler(),
qVersion()
);
QString aboutText; QString aboutText;
aboutText += QString("<h2>%1</h2>").arg(tr("LameXP &minus; Audio Encoder Front-end")); aboutText += QString("<h2>%1</h2>").arg(tr("LameXP &minus; Audio Encoder Front-end"));
aboutText += QString("<b>Copyright (C) 2004-%1 LoRd_MuldeR &lt;MuldeR2@GMX.de&gt;. Some rights reserved.</b><br>").arg(max(lamexp_version_date().year(),QDate::currentDate().year())); aboutText += QString("<b>Copyright (C) 2004-%1 LoRd_MuldeR &lt;MuldeR2@GMX.de&gt;. Some rights reserved.</b><br>").arg(max(lamexp_version_date().year(),QDate::currentDate().year()));
aboutText += lamexp_version_demo() ? QString("<b>%1, %2</b><br><br>").arg(versionStr, tr("DEMO VERSION")) : QString("<b>%1</b><br><br>").arg(versionStr); aboutText += QString("<b>%1</b><br><br>").arg(versionStr);
aboutText += QString("<nobr>%1</nobr><br>").arg(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url()))); aboutText += QString("<nobr>%1</nobr><br>").arg(tr("Please visit %1 for news and updates!").arg(LINK(lamexp_website_url())));
aboutText += lamexp_version_demo() ? QString("<nobr><font color=\"darkred\">%1</font></nobr><br>").arg(tr("Note: This demo (pre-release) version of LameXP will expire at %1.").arg(lamexp_version_expires().toString(Qt::ISODate))) : QString();
aboutText += "<hr><br>"; aboutText += "<hr><br>";
aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or<br>"; aboutText += "<nobr><tt>This program is free software; you can redistribute it and/or<br>";
aboutText += "modify it under the terms of the GNU General Public License<br>"; aboutText += "modify it under the terms of the GNU General Public License<br>";

View File

@ -115,19 +115,45 @@ static const char *g_lamexp_version_raw_date = __DATE__;
//Console attached flag //Console attached flag
static bool g_lamexp_console_attached = false; static bool g_lamexp_console_attached = false;
//Compiler version //Compiler detection
#if _MSC_VER == 1400 //The following code was borrowed from MPC-HC project: http://mpc-hc.sf.net/
static const char *g_lamexp_version_compiler = "MSVC 8.0"; #if defined(__INTEL_COMPILER)
#if (__INTEL_COMPILER >= 1200)
static const char *g_lamexp_version_compiler = "ICL 12.x";
#elif (__INTEL_COMPILER >= 1100)
static const char *g_lamexp_version_compiler = = "ICL 11.x";
#elif (__INTEL_COMPILER >= 1000)
static const char *g_lamexp_version_compiler = = "ICL 10.x";
#else #else
#if _MSC_VER == 1500 #error Compiler is not supported!
static const char *g_lamexp_version_compiler = "MSVC 9.0"; #endif
#elif defined(_MSC_VER)
#if (_MSC_VER == 1600)
#if (_MSC_FULL_VER >= 160040219)
static const char *g_lamexp_version_compiler = "MSVC 2010-SP1";
#else #else
#if _MSC_VER == 1600 static const char *g_lamexp_version_compiler = "MSVC 2010";
static const char *g_lamexp_version_compiler = "MSVC 10.0"; #endif
#elif (_MSC_VER == 1500)
#if (_MSC_FULL_VER >= 150030729)
static const char *g_lamexp_version_compiler = "MSVC 2008-SP1";
#else #else
static const char *g_lamexp_version_compiler = "UNKNOWN"; static const char *g_lamexp_version_compiler = "MSVC 2008";
#endif
#else
#error Compiler is not supported!
#endif
// Note: /arch:SSE and /arch:SSE2 are only available for the x86 platform
#if !defined(_M_X64) && defined(_M_IX86_FP)
#if (_M_IX86_FP == 1)
LAMEXP_COMPILER_WARNING("SSE instruction set is enabled!")
#elif (_M_IX86_FP == 2)
LAMEXP_COMPILER_WARNING("SSE2 instruction set is enabled!")
#endif #endif
#endif #endif
#else
#error Compiler is not supported!
#endif #endif
//Official web-site URL //Official web-site URL

View File

@ -161,6 +161,8 @@ SIZE_T lamexp_dbg_private_bytes(void);
#endif #endif
//Check for CPU-compatibility options //Check for CPU-compatibility options
#if _M_IX86_FP != 0 #if !defined(_M_X64) && defined(_M_IX86_FP)
#if (_M_IX86_FP != 0)
#error We should not enabled SSE or SSE2 in release builds! #error We should not enabled SSE or SSE2 in release builds!
#endif #endif
#endif

View File

@ -32,4 +32,3 @@
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows 2000. #ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows 2000.
#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows. #define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows.
#endif #endif