Added preprocessor define _VC71 to VC7.1 project & exclude LOG'ing for VC7.1 builds (only affects debug builds)

This commit is contained in:
tomch 2007-04-04 21:28:10 +00:00
parent 9794ccbdbe
commit 3bfac2b933
3 changed files with 25 additions and 14 deletions

View File

@ -24,7 +24,7 @@
AdditionalOptions="/Zm200 "
Optimization="2"
InlineFunctionExpansion="2"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_VC71"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
@ -86,7 +86,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/Zm200 "
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_VC71"
RuntimeLibrary="5"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Debug/Applewin.pch"

View File

@ -31,12 +31,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define LOG_DISK_ENABLED 1
#ifndef _VC71
#if LOG_DISK_ENABLED
// __VA_ARGS__ not supported on MSVC++ .NET 7.x
#define LOG_DISK(format, params) LOG(format, params)
#else
#define LOG_DISK(format, params)
#endif
#endif
// Public _________________________________________________________________________________________
@ -197,7 +199,9 @@ static void ReadTrack (int iDrive)
if (pFloppy->trackimage && pFloppy->imagehandle)
{
LOG_DISK("read track %2X%s\r", (pFloppy->track, (pFloppy->phase & 1) ? ".5" : ""));
#ifndef _VC71
LOG_DISK("read track %2X%s\r", pFloppy->track, (pFloppy->phase & 1) ? ".5" : "");
#endif
ImageReadTrack(
pFloppy->imagehandle,
pFloppy->track,
@ -290,13 +294,17 @@ BYTE __stdcall DiskControlStepper (WORD, BYTE address, BYTE, BYTE, ULONG)
{
// phase on
phases |= phase_bit;
LOG_DISK("track %02X phases %X phase %d on address $C0E%X\r", (fptr->phase, phases, phase, address & 0xF));
#ifndef _VC71
LOG_DISK("track %02X phases %X phase %d on address $C0E%X\r", fptr->phase, phases, phase, address & 0xF);
#endif
}
else
{
// phase off
phases &= ~phase_bit;
LOG_DISK("track %02X phases %X phase %d off address $C0E%X\r", (fptr->phase, phases, phase, address & 0xF));
#ifndef _VC71
LOG_DISK("track %02X phases %X phase %d off address $C0E%X\r", fptr->phase, phases, phase, address & 0xF);
#endif
}
// check for any stepping effect from a magnet
@ -318,7 +326,9 @@ BYTE __stdcall DiskControlStepper (WORD, BYTE address, BYTE, BYTE, ULONG)
{
fptr->phase = MAX(0, MIN(79, fptr->phase + direction));
int newtrack = MIN(TRACKS-1, fptr->phase >> 1); // (round half tracks down)
LOG_DISK("newtrack %2X%s\r", (newtrack, (fptr->phase & 1) ? ".5" : ""));
#ifndef _VC71
LOG_DISK("newtrack %2X%s\r", newtrack, (fptr->phase & 1) ? ".5" : "");
#endif
if (newtrack != fptr->track)
{
if (fptr->trackimage && fptr->trackimagedirty)
@ -497,7 +507,9 @@ BYTE __stdcall DiskReadWrite (WORD programcounter, BYTE, BYTE, BYTE, ULONG) {
#if LOG_DISK_ENABLED
if (0)
{
LOG_DISK("nib %4X = %2X\r", (fptr->byte, result));
#ifndef _VC71
LOG_DISK("nib %4X = %2X\r", fptr->byte, result);
#endif
}
#endif
if (++fptr->byte >= fptr->nibbles)

View File

@ -1,12 +1,11 @@
#pragma once
#if _DEBUG
// __VA_ARGS__ not supported on MSVC++ .NET 7.x
// #define LOG(format, ...) LogOutput(format, __VA_ARGS__)
#define LOG(format, params) LogOutput(format, params)
#else
// #define LOG(...)
#define LOG(format, params)
#ifndef _VC71 // __VA_ARGS__ not supported on MSVC++ .NET 7.x
#ifdef _DEBUG
#define LOG(format, ...) LogOutput(format, __VA_ARGS__)
#else
#define LOG(...)
#endif
#endif
extern void LogOutput(LPCTSTR format, ...);