Slightly refactored macros.

This commit is contained in:
LoRd_MuldeR 2011-04-14 01:40:11 +02:00
parent 2b2ec1df12
commit 26fe0b0499
4 changed files with 63 additions and 38 deletions

View File

@ -77,7 +77,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CONFIG_NAME=$(ConfigurationName);WIN32;_DEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@ -102,6 +102,9 @@ copy "$(QTDIR)\plugins\imageformats\q???d4.dll" "$(TargetDir)imageformats\"
copy "$(QTDIR)\plugins\imageformats\q????d4.dll" "$(TargetDir)imageformats\"
</Command>
</PostBuildEvent>
<ResourceCompile>
<PreprocessorDefinitions>_CONFIG_NAME=$(ConfigurationName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
@ -120,7 +123,7 @@ copy "$(QTDIR)\plugins\imageformats\q????d4.dll" "$(TargetDir)imageformats\"
<OmitFramePointers>true</OmitFramePointers>
<WholeProgramOptimization>true</WholeProgramOptimization>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CONFIG_NAME=$(ConfigurationName);WIN32;NDEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_DLL;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@ -162,6 +165,9 @@ copy "$(QTDIR)\plugins\imageformats\q????4.dll" "$(TargetDir)imageformats\"
del "$(TargetDir)imageformats\q???d4.dll"
</Command>
</PostBuildEvent>
<ResourceCompile>
<PreprocessorDefinitions>_CONFIG_NAME=$(ConfigurationName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Static|Win32'">
<PreBuildEvent>
@ -180,7 +186,7 @@ del "$(TargetDir)imageformats\q???d4.dll"
<OmitFramePointers>true</OmitFramePointers>
<WholeProgramOptimization>true</WholeProgramOptimization>
<AdditionalIncludeDirectories>$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_NO_DEBUG;QT_NODLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_CONFIG_NAME=$(ConfigurationName);WIN32;NDEBUG;_CONSOLE;QT_LARGEFILE_SUPPORT;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_NO_DEBUG;QT_NODLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@ -216,6 +222,9 @@ del "$(TargetDir)imageformats\q???d4.dll"
<Command>
</Command>
</PostBuildEvent>
<ResourceCompile>
<PreprocessorDefinitions>_CONFIG_NAME=$(ConfigurationName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\Decoder_AAC.cpp" />
@ -974,7 +983,9 @@ del "$(TargetDir)imageformats\q???d4.dll"
<None Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="LameXP.rc" />
<ResourceCompile Include="LameXP.rc">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">_CONFIG_NAME=$(ConfigurationName);%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -19,30 +19,42 @@
// http://www.gnu.org/licenses/gpl-2.0.txt
///////////////////////////////////////////////////////////////////////////////
/*
* LameXP Version Info
*/
#pragma once
///////////////////////////////////////////////////////////////////////////////
// LameXP Version Info
///////////////////////////////////////////////////////////////////////////////
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 2
#define VER_LAMEXP_BUILD 439
#define VER_LAMEXP_SUFFIX Alpha-2
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 3
#define VER_LAMEXP_BUILD 441
///////////////////////////////////////////////////////////////////////////////
// Tools versions
///////////////////////////////////////////////////////////////////////////////
/*
* Tools versions
*/
#define VER_LAMEXP_TOOL_NEROAAC 1540
/*
* Helper macros (aka: having fun with the C pre-processor)
*/
///////////////////////////////////////////////////////////////////////////////
// Helper macros (aka: having fun with the C pre-processor)
///////////////////////////////////////////////////////////////////////////////
#define VER_LAMEXP_SUFFIX_HLP1(X,Y) X-Y
#define VER_LAMEXP_SUFFIX_HLP2(X,Y) VER_LAMEXP_SUFFIX_HLP1(X,Y)
#define VER_LAMEXP_SUFFIX VER_LAMEXP_SUFFIX_HLP2(VER_LAMEXP_TYPE, VER_LAMEXP_PATCH)
#define VER_LAMEXP_STR_HLP1(X) #X
#define VER_LAMEXP_STR_HLP2(V,W,X,Y,Z) VER_LAMEXP_STR_HLP1(v##V.W##X Z [Build Y])
#define VER_LAMEXP_STR_HLP3(V,W,X,Y,Z) VER_LAMEXP_STR_HLP2(V,W,X,Y,Z)
#define VER_LAMEXP_STR VER_LAMEXP_STR_HLP3(VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD,VER_LAMEXP_SUFFIX)
#define VER_LAMEXP_STR_HLP2(U,V,W,X,Y,Z) VER_LAMEXP_STR_HLP1(v##U.V##W Y; Build X; Z)
#define VER_LAMEXP_STR_HLP3(U,V,W,X,Y,Z) VER_LAMEXP_STR_HLP2(U,V,W,X,Y,Z)
#define VER_LAMEXP_STR VER_LAMEXP_STR_HLP3(VER_LAMEXP_MAJOR,VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO,VER_LAMEXP_BUILD,VER_LAMEXP_SUFFIX,_CONFIG_NAME)
#define VER_LAMEXP_RNAME_HLP1(X) #X
#define VER_LAMEXP_RNAME_HLP2(X) VER_LAMEXP_RNAME_HLP1(X)
#define VER_LAMEXP_RNAME VER_LAMEXP_RNAME_HLP2(VER_LAMEXP_SUFFIX)
#define VER_LAMEXP_MINOR_HLP1(X,Y) X##Y
#define VER_LAMEXP_MINOR_HLP2(X,Y) VER_LAMEXP_MINOR_HLP1(X,Y)
#define VER_LAMEXP_MINOR VER_LAMEXP_MINOR_HLP2(VER_LAMEXP_MINOR_HI,VER_LAMEXP_MINOR_LO)

View File

@ -135,15 +135,12 @@ SIZE_T lamexp_dbg_private_bytes(void);
#define qFatal64(FORMAT, ...) qFatal("@BASE64@%s", QString(FORMAT).arg(__VA_ARGS__).toUtf8().toBase64().constData());
//Check for debug build
#if defined(_DEBUG) || defined(QT_DEBUG) || !defined(NDEBUG) || !defined(QT_NO_DEBUG)
#if defined(_DEBUG) && defined(QT_DEBUG) && !defined(NDEBUG) && !defined(QT_NO_DEBUG)
#define LAMEXP_DEBUG (1)
#define LAMEXP_CHECK_DEBUG_BUILD \
qWarning("---------------------------------------------------------"); \
qWarning("DEBUG BUILD: DO NOT RELEASE THIS BINARY TO THE PUBLIC !!!"); \
qWarning("---------------------------------------------------------\n");
#else
#elif defined(NDEBUG) && defined(QT_NO_DEBUG) && !defined(_DEBUG) && !defined(QT_DEBUG)
#define LAMEXP_DEBUG (0)
#define LAMEXP_CHECK_DEBUG_BUILD
#else
#error Inconsistent debug defines detected!
#endif
//Memory check

View File

@ -63,7 +63,12 @@ int lamexp_main(int argc, char* argv[])
qDebug("This program comes with ABSOLUTELY NO WARRANTY.\n");
//Print warning, if this is a "debug" build
LAMEXP_CHECK_DEBUG_BUILD;
if(LAMEXP_DEBUG)
{
qWarning("---------------------------------------------------------");
qWarning("DEBUG BUILD: DO NOT RELEASE THIS BINARY TO THE PUBLIC !!!");
qWarning("---------------------------------------------------------\n");
}
//Detect CPU capabilities
lamexp_cpu_t cpuFeatures = lamexp_detect_cpu_features();