From e7f93f2def159215ae8ca1c31d1f8f1496fef8d0 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sun, 18 Nov 2018 11:12:49 +1030 Subject: [PATCH] [Project64] Remove #include from Common/Trace.h --- Source/Common/CriticalSection.cpp | 3 +++ Source/Common/HighResTimeStamp.cpp | 4 +++- Source/Common/Thread.cpp | 4 +++- Source/Common/Trace.h | 6 ++---- Source/Project64-audio/AudioMain.cpp | 4 ++++ Source/Project64-core/N64System/Mips/FlashRam.cpp | 4 ---- Source/Project64-core/N64System/Mips/Sram.cpp | 4 ---- Source/Project64-video/Main.cpp | 1 + Source/Project64-video/ScreenResolution.cpp | 4 +++- 9 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Source/Common/CriticalSection.cpp b/Source/Common/CriticalSection.cpp index a1ea7bfcc..cacb214d9 100644 --- a/Source/Common/CriticalSection.cpp +++ b/Source/Common/CriticalSection.cpp @@ -1,4 +1,7 @@ #include "stdafx.h" +#ifdef _WIN32 +#include +#endif CriticalSection::CriticalSection() { diff --git a/Source/Common/HighResTimeStamp.cpp b/Source/Common/HighResTimeStamp.cpp index 29a59b130..926ee3907 100644 --- a/Source/Common/HighResTimeStamp.cpp +++ b/Source/Common/HighResTimeStamp.cpp @@ -1,6 +1,8 @@ #include "stdafx.h" #include "HighResTimeStamp.h" -#ifndef _WIN32 +#ifdef _WIN32 +#include +#else #include #endif diff --git a/Source/Common/Thread.cpp b/Source/Common/Thread.cpp index b47145453..a8cc74f82 100644 --- a/Source/Common/Thread.cpp +++ b/Source/Common/Thread.cpp @@ -1,6 +1,8 @@ #include "stdafx.h" #include "Thread.h" -#ifndef _WIN32 +#ifdef _WIN32 +#include +#else #include #include #include diff --git a/Source/Common/Trace.h b/Source/Common/Trace.h index 8f6440bc7..fb63555ea 100644 --- a/Source/Common/Trace.h +++ b/Source/Common/Trace.h @@ -11,10 +11,8 @@ enum TraceSeverity TraceVerbose = 0x00000006, }; -#if defined(_WIN32) -#include -#else -#define __interface struct +#ifndef _WIN32 +#define __interface struct #endif __interface CTraceModule diff --git a/Source/Project64-audio/AudioMain.cpp b/Source/Project64-audio/AudioMain.cpp index 5b16a8392..fd9e9bc00 100644 --- a/Source/Project64-audio/AudioMain.cpp +++ b/Source/Project64-audio/AudioMain.cpp @@ -249,6 +249,10 @@ EXPORT void CALL ProcessAList(void) WriteTrace(TraceAudioInterface, TraceDebug, "Called"); } +#ifdef _WIN32 +#include +#endif + extern "C" void UseUnregisteredSetting(int /*SettingID*/) { WriteTrace(TraceAudioInterface, TraceDebug, "Called"); diff --git a/Source/Project64-core/N64System/Mips/FlashRam.cpp b/Source/Project64-core/N64System/Mips/FlashRam.cpp index d20d2554b..2fc760de7 100644 --- a/Source/Project64-core/N64System/Mips/FlashRam.cpp +++ b/Source/Project64-core/N64System/Mips/FlashRam.cpp @@ -133,11 +133,7 @@ bool CFlashram::LoadFlashram() if (!m_File.Open(FileName, (m_ReadOnly ? CFileBase::modeRead : CFileBase::modeReadWrite) | CFileBase::modeNoTruncate | CFileBase::modeCreate)) { -#ifdef _WIN32 - WriteTrace(TraceN64System, TraceError, "Failed to open (%s), ReadOnly = %d, LastError = %X", (const char *)FileName, m_ReadOnly, GetLastError()); -#else WriteTrace(TraceN64System, TraceError, "Failed to open (%s), ReadOnly = %d", (const char *)FileName, m_ReadOnly); -#endif g_Notify->DisplayError(GS(MSG_FAIL_OPEN_FLASH)); return false; } diff --git a/Source/Project64-core/N64System/Mips/Sram.cpp b/Source/Project64-core/N64System/Mips/Sram.cpp index 1d9525f05..42ab34b65 100644 --- a/Source/Project64-core/N64System/Mips/Sram.cpp +++ b/Source/Project64-core/N64System/Mips/Sram.cpp @@ -36,11 +36,7 @@ bool CSram::LoadSram() if (!m_File.Open(FileName, (m_ReadOnly ? CFileBase::modeRead : CFileBase::modeReadWrite) | CFileBase::modeNoTruncate | CFileBase::modeCreate)) { -#ifdef _WIN32 - WriteTrace(TraceN64System, TraceError, "Failed to open (%s), ReadOnly = %d, LastError = %X", (const char *)FileName, m_ReadOnly, GetLastError()); -#else WriteTrace(TraceN64System, TraceError, "Failed to open (%s), ReadOnly = %d", (const char *)FileName, m_ReadOnly); -#endif return false; } m_File.SeekToBegin(); diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index ed993a0f9..bf487d150 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -37,6 +37,7 @@ #include "ScreenResolution.h" #ifdef _WIN32 +#include #include #endif diff --git a/Source/Project64-video/ScreenResolution.cpp b/Source/Project64-video/ScreenResolution.cpp index 73f341d5e..aa03fc455 100644 --- a/Source/Project64-video/ScreenResolution.cpp +++ b/Source/Project64-video/ScreenResolution.cpp @@ -11,7 +11,9 @@ #include "ScreenResolution.h" #include "settings.h" #include "trace.h" - +#ifdef _WIN32 +#include +#endif #ifdef ANDROID #include #include