Rearrange LogManager includes. The main purpose is to make it possible to modify Thread.h without recompiling the whole entire project.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3770 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Nolan Check 2009-07-12 21:58:32 +00:00
parent 839ed9103d
commit d85f5a6937
27 changed files with 68 additions and 34 deletions

View File

@ -19,6 +19,7 @@
#define _MIXER_H_ #define _MIXER_H_
#include "FixedSizeQueue.h" #include "FixedSizeQueue.h"
#include "Thread.h"
// On real hardware, this fifo is much, much smaller. But timing is also // On real hardware, this fifo is much, much smaller. But timing is also
// tighter than under Windows, so... // tighter than under Windows, so...

View File

@ -85,16 +85,16 @@
#define HAVE_SFML 1 #define HAVE_SFML 1
#define HAVE_OPENAL 1 #define HAVE_OPENAL 1
namespace
{
// it is VERY DANGEROUS to mix _SECURE_SCL=0 and _SECURE_SCL=1 compiled libraries. // it is VERY DANGEROUS to mix _SECURE_SCL=0 and _SECURE_SCL=1 compiled libraries.
// You will get bizarre crash bugs whenever you use STL. // You will get bizarre crash bugs whenever you use STL.
#ifndef _SECURE_SCL namespace
#error Please define _SECURE_SCL=0 in the project settings {
#else #ifndef _SECURE_SCL
CompileTimeAssert<_SECURE_SCL==0> x; #error Please define _SECURE_SCL=0 in the project settings
#endif #else
} CompileTimeAssert<_SECURE_SCL==0> x;
#endif
}
// Debug definions // Debug definions
#if defined(_DEBUG) #if defined(_DEBUG)
@ -111,7 +111,7 @@ namespace
#define MAX_PATH 260 #define MAX_PATH 260
// Windows compatibility // Windows compatibility
#define __forceinline inline #define __forceinline inline __attribute__((always_inline))
#ifdef _LP64 #ifdef _LP64
#define _M_X64 1 #define _M_X64 1
@ -119,11 +119,12 @@ namespace
#define _M_IX86 1 #define _M_IX86 1
#endif #endif
// Alignment // Alignment
#define GC_ALIGNED16(x) __attribute((aligned(16))) x #define GC_ALIGNED16(x) __attribute__((aligned(16))) x
#define GC_ALIGNED32(x) __attribute((aligned(16))) x #define GC_ALIGNED32(x) __attribute__((aligned(16))) x
#define GC_ALIGNED64(x) __attribute((aligned(64))) x #define GC_ALIGNED64(x) __attribute__((aligned(64))) x
#define GC_ALIGNED16_DECL(x) __attribute((aligned(16))) x #define GC_ALIGNED16_DECL(x) __attribute__((aligned(16))) x
#define GC_ALIGNED64_DECL(x) __attribute((aligned(64))) x #define GC_ALIGNED64_DECL(x) __attribute__((aligned(64))) x
#endif // WIN32 #endif // WIN32
// A macro to disallow the copy constructor and operator= functions // A macro to disallow the copy constructor and operator= functions

View File

@ -17,6 +17,7 @@
#include "Common.h" #include "Common.h"
#include "FileUtil.h" #include "FileUtil.h"
#include "StringUtil.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <windows.h>

View File

@ -102,15 +102,14 @@ enum LOG_LEVELS {
#define INFO_LOG(...) {} #define INFO_LOG(...) {}
#define DEBUG_LOG(...) {} #define DEBUG_LOG(...) {}
// FIXME can we get rid of this? void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char *fmt, ...);
#include "LogManager.h"
#ifdef GEKKO #ifdef GEKKO
#define GENERIC_LOG(t, v, ...) #define GENERIC_LOG(t, v, ...)
#else #else
// Let the compiler optimize this out // Let the compiler optimize this out
#define GENERIC_LOG(t, v, ...) {if (v <= MAX_LOGLEVEL) {LogManager::GetInstance()->Log(v, t, __VA_ARGS__);}} #define GENERIC_LOG(t, v, ...) {if (v <= MAX_LOGLEVEL) {GenericLog(v, t, __VA_ARGS__);}}
#endif #endif
#if MAX_LOGLEVEL >= ERROR_LEVEL #if MAX_LOGLEVEL >= ERROR_LEVEL

View File

@ -18,6 +18,14 @@
#include "LogManager.h" #include "LogManager.h"
#include "Timer.h" #include "Timer.h"
void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
LogManager::GetInstance()->Log(level, type, fmt, args);
va_end(args);
}
LogManager *LogManager::m_logManager = NULL; LogManager *LogManager::m_logManager = NULL;
LogManager::LogManager()\ LogManager::LogManager()\
@ -85,8 +93,7 @@ LogManager::~LogManager() {
} }
void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
const char *format, ...) { const char *format, va_list args) {
va_list args;
char temp[MAX_MSGLEN]; char temp[MAX_MSGLEN];
char msg[MAX_MSGLEN + 512]; char msg[MAX_MSGLEN + 512];
@ -95,9 +102,7 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
if (! log->isEnable() || level > log->getLevel()) if (! log->isEnable() || level > log->getLevel())
return; return;
va_start(args, format);
CharArrayFromFormatV(temp, MAX_MSGLEN, format, args); CharArrayFromFormatV(temp, MAX_MSGLEN, format, args);
va_end(args);
static const char level_to_char[7] = "-NEWID"; static const char level_to_char[7] = "-NEWID";
sprintf(msg, "%s %c[%s]: %s\n", sprintf(msg, "%s %c[%s]: %s\n",

View File

@ -137,7 +137,7 @@ public:
static u32 GetMaxLevel() { return MAX_LOGLEVEL; } static u32 GetMaxLevel() { return MAX_LOGLEVEL; }
void Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, void Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
const char *fmt, ...); const char *fmt, va_list args);
void setLogLevel(LogTypes::LOG_TYPE type, LogTypes::LOG_LEVELS level) { void setLogLevel(LogTypes::LOG_TYPE type, LogTypes::LOG_LEVELS level) {
m_Log[type]->setLevel(level); m_Log[type]->setLevel(level);

View File

@ -18,10 +18,11 @@
#ifndef _MATH_UTIL_H_ #ifndef _MATH_UTIL_H_
#define _MATH_UTIL_H_ #define _MATH_UTIL_H_
#include <xmmintrin.h>
#include "Common.h" #include "Common.h"
#include <xmmintrin.h>
#include <vector>
namespace MathUtil namespace MathUtil
{ {

View File

@ -24,6 +24,7 @@
#include <string> #include <string>
#include <map> #include <map>
#include <vector>
#include "Common.h" #include "Common.h"

View File

@ -15,11 +15,6 @@
// Official SVN repository and contact information can be found at // Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#ifdef _WIN32
#include <windows.h>
#include <mmsystem.h>
#endif
#include <time.h> #include <time.h>
#include <sys/timeb.h> #include <sys/timeb.h>

View File

@ -21,6 +21,7 @@
#include "Common.h" #include "Common.h"
#include <string> #include <string>
#ifdef _WIN32 #ifdef _WIN32
#include <Windows.h>
#include <mmsystem.h> #include <mmsystem.h>
#endif #endif
namespace Common namespace Common

View File

@ -18,6 +18,8 @@
#ifndef _EXI_DEVICEMEMORYCARD_H #ifndef _EXI_DEVICEMEMORYCARD_H
#define _EXI_DEVICEMEMORYCARD_H #define _EXI_DEVICEMEMORYCARD_H
#include "Thread.h"
// Data structure to be passed to the flushing thread. // Data structure to be passed to the flushing thread.
typedef struct typedef struct
{ {

View File

@ -22,6 +22,7 @@
#include "Common.h" #include "Common.h"
#include "ChunkFile.h" #include "ChunkFile.h"
#include "Thread.h"
#include "PixelEngine.h" #include "PixelEngine.h"

View File

@ -20,6 +20,7 @@
#include "State.h" #include "State.h"
#include "Core.h" #include "Core.h"
#include "StringUtil.h" #include "StringUtil.h"
#include "Thread.h"
#include "CoreTiming.h" #include "CoreTiming.h"
#include "HW/HW.h" #include "HW/HW.h"
#include "PowerPC/PowerPC.h" #include "PowerPC/PowerPC.h"

View File

@ -20,6 +20,8 @@
#ifndef _STATE_H_ #ifndef _STATE_H_
#define _STATE_H_ #define _STATE_H_
#include <string>
typedef struct typedef struct
{ {
u8 *buffer; u8 *buffer;

View File

@ -26,6 +26,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "Common.h"
#include "FileUtil.h" #include "FileUtil.h"
#include "disassemble.h" #include "disassemble.h"
#include "DSPTables.h" #include "DSPTables.h"
@ -34,6 +35,10 @@
#pragma warning(disable:4996) #pragma warning(disable:4996)
#endif #endif
#ifndef MAX_PATH
#include <Windows.h> // For MAX_PATH
#endif
extern void nop(const UDSPInstruction& opc); extern void nop(const UDSPInstruction& opc);
DSPDisassembler::DSPDisassembler(const AssemblerSettings &settings) DSPDisassembler::DSPDisassembler(const AssemblerSettings &settings)

View File

@ -37,6 +37,11 @@
#include <wx/wx.h> #include <wx/wx.h>
#endif #endif
#ifdef _WIN32
#define NOMINMAX
#include <Windows.h>
#endif
#include "SDL.h" // Local #include "SDL.h" // Local
//////////////////////////////////// ////////////////////////////////////

View File

@ -24,6 +24,7 @@
#include "CommonPaths.h" #include "CommonPaths.h"
#include "FileUtil.h" #include "FileUtil.h"
#include "FileSearch.h" #include "FileSearch.h"
#include "StringUtil.h"
namespace HiresTextures namespace HiresTextures
{ {

View File

@ -34,6 +34,7 @@ DSPDebuggerHLE* m_DebuggerFrame = NULL;
#include "Setup.h" #include "Setup.h"
#include "StringUtil.h" #include "StringUtil.h"
#include "AudioCommon.h" #include "AudioCommon.h"
#include "LogManager.h"
// Declarations and definitions // Declarations and definitions

View File

@ -18,7 +18,9 @@
#include "Common.h" // Common #include "Common.h" // Common
#include "CommonTypes.h" #include "CommonTypes.h"
#include "Mixer.h" #include "LogManager.h"
#include "Thread.h"
#include "ChunkFile.h"
#include "Globals.h" // Local #include "Globals.h" // Local
#include "DSPInterpreter.h" #include "DSPInterpreter.h"
@ -28,11 +30,9 @@
#include "Config.h" #include "Config.h"
#include "AudioCommon.h" #include "AudioCommon.h"
#include "Mixer.h"
#include "Logging/Logging.h" // For Logging #include "Logging/Logging.h" // For Logging
#include "Thread.h"
#include "ChunkFile.h"
#include "DSPTables.h" #include "DSPTables.h"
#include "DSPCore.h" #include "DSPCore.h"

View File

@ -22,6 +22,7 @@
#include <math.h> #include <math.h>
#include "Common.h" #include "Common.h"
#include "LogManager.h"
#include "pluginspecs_pad.h" #include "pluginspecs_pad.h"
#include "PadSimple.h" #include "PadSimple.h"
#include "IniFile.h" #include "IniFile.h"

View File

@ -20,6 +20,8 @@
#include <d3dx9.h> #include <d3dx9.h>
#include "Common.h" #include "Common.h"
#include "Thread.h"
#include "LogManager.h"
#include "svnrev.h" #include "svnrev.h"
#include "resource.h" #include "resource.h"

View File

@ -20,6 +20,8 @@
#include "Common.h" #include "Common.h"
#include <string>
// Log in two categories, and save three other options in the same byte // Log in two categories, and save three other options in the same byte
#define CONF_LOG 1 #define CONF_LOG 1
#define CONF_PRIMLOG 2 #define CONF_PRIMLOG 2

View File

@ -17,6 +17,7 @@
#include "Globals.h" #include "Globals.h"
#include "Thread.h"
#include <vector> #include <vector>
#include <cmath> #include <cmath>

View File

@ -52,6 +52,8 @@ Make AA apply instantly during gameplay if possible
#include "Globals.h" #include "Globals.h"
#include "LogManager.h"
#include "Thread.h"
#include <cstdarg> #include <cstdarg>

View File

@ -33,6 +33,7 @@ and Wiimote functions worked.
*/ */
#include "Common.h" // Common #include "Common.h" // Common
#include "LogManager.h"
#include "StringUtil.h" #include "StringUtil.h"
#include "Timer.h" #include "Timer.h"

View File

@ -69,6 +69,7 @@
// Include // Include
// ¯¯¯¯¯¯¯¯¯ // ¯¯¯¯¯¯¯¯¯
#include "nJoy.h" #include "nJoy.h"
#include "LogManager.h"
// Declare config window so that we can write debugging info to it from functions in this file // Declare config window so that we can write debugging info to it from functions in this file
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX

View File

@ -30,6 +30,7 @@
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
#include "nJoy.h" #include "nJoy.h"
#include "LogManager.h"
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Variables // Variables