diff --git a/src/common.h b/src/common.h index dc52a6a..10856d0 100644 --- a/src/common.h +++ b/src/common.h @@ -7,26 +7,14 @@ #ifndef _COMMON_H_ #define _COMMON_H_ -#include -#include - -#pragma comment(lib, "Gdiplus.lib") -using namespace Gdiplus; - -#ifdef _DEBUG - // detect memory leaks - #define _CRTDBG_MAP_ALLOC - #include - #define malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__) - #define new new(_NORMAL_BLOCK, __FILE__, __LINE__) -#endif - -#include - -#if defined(_MSC_VER) && _MSC_VER == 1200 - // variable scope of 'for' loop for Microsoft Visual C++ 6.0 - #define for if(0);else for +// tchar.h shim +typedef char _TCHAR; +#ifndef _T +#define _T(s) s #endif +#define _tfopen_s fopen_s +#define _tcscpy_s strcpy_s +#define _stprintf_s sprintf_s // type definition #ifndef uint8 diff --git a/src/fileio.cpp b/src/fileio.cpp index cb61930..605765f 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -34,7 +34,7 @@ bool FILEIO::Fopen(_TCHAR *filename, int mode) } else if(mode == FILEIO_READ_WRITE_BINARY) { _tfopen_s(&fp, filename, _T("r+b")); } else if(mode == FILEIO_READ_ASCII) { - _tfopen_s(&fp, filename, __T("r")); + _tfopen_s(&fp, filename, _T("r")); } else if(mode == FILEIO_WRITE_ASCII) { _tfopen_s(&fp, filename, _T("w")); } else if(mode == FILEIO_READ_WRITE_ASCII) { diff --git a/src/sys/ags.cpp b/src/sys/ags.cpp index 1f25821..7388d06 100644 --- a/src/sys/ags.cpp +++ b/src/sys/ags.cpp @@ -7,6 +7,7 @@ #include "ags.h" #include "crc32.h" #include "../fileio.h" +using namespace Gdiplus; extern _TCHAR g_root[_MAX_PATH]; extern HWND g_hwnd;