diff options
author | Einar Johan Trøan Sømåen | 2012-06-08 18:24:41 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-08 18:29:48 +0200 |
commit | 1d5e59766fc1e6083921741a1ad270dd8d9363d1 (patch) | |
tree | c8800d2745d0c6bc30d8b03c5f1dc3c693ff1d5a /engines | |
parent | 8adae39ca4e239889469e1017da4d697c892e7f3 (diff) | |
download | scummvm-rg350-1d5e59766fc1e6083921741a1ad270dd8d9363d1.tar.gz scummvm-rg350-1d5e59766fc1e6083921741a1ad270dd8d9363d1.tar.bz2 scummvm-rg350-1d5e59766fc1e6083921741a1ad270dd8d9363d1.zip |
WINTERMUTE: Move FORBIDDEN_SYMBOL_EXCEPTION out of the headers and into the CPP-files that still need it.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wintermute/Base/BGame.cpp | 11 | ||||
-rw-r--r-- | engines/wintermute/Base/BRegistry.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/Base/BRenderSDL.cpp | 5 | ||||
-rw-r--r-- | engines/wintermute/Base/scriptables/SXFile.cpp | 44 | ||||
-rw-r--r-- | engines/wintermute/Base/scriptables/SXFile.h | 2 | ||||
-rw-r--r-- | engines/wintermute/Base/scriptables/ScEngine.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/Sys/SysClass.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/utils/utils.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/wintypes.h | 5 |
9 files changed, 56 insertions, 26 deletions
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp index 631fdfd43d..074aad18ff 100644 --- a/engines/wintermute/Base/BGame.cpp +++ b/engines/wintermute/Base/BGame.cpp @@ -25,8 +25,17 @@ * http://dead-code.org/redir.php?target=wmelite
* Copyright (c) 2011 Jan Nedoma
*/
-
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <time.h>
+#undef FORBIDDEN_SYMBOL_ALLOW_ALL
+#define FORBIDDEN_SYMBOL_EXCEPTION_srand
+#define FORBIDDEN_SYMBOL_EXCEPTION_time
+#define FORBIDDEN_SYMBOL_EXCEPTION_time
+#define FORBIDDEN_SYMBOL_EXCEPTION_localtime
+#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
+#define FORBIDDEN_SYMBOL_EXCEPTION_fopen
+#define FORBIDDEN_SYMBOL_EXCEPTION_fclose
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
#include "engines/wintermute/dcgf.h"
#include "engines/wintermute/Base/BGame.h"
#include "engines/wintermute/Base/BFader.h"
diff --git a/engines/wintermute/Base/BRegistry.cpp b/engines/wintermute/Base/BRegistry.cpp index 06a8a63f4f..fcb20ad54f 100644 --- a/engines/wintermute/Base/BRegistry.cpp +++ b/engines/wintermute/Base/BRegistry.cpp @@ -26,7 +26,10 @@ * Copyright (c) 2011 Jan Nedoma
*/
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <fstream>
+#include "engines/wintermute/tinyxml/tinyxml.h"
+#undef FORBIDDEN_SYMBOL_ALLOW_ALL
#include "engines/wintermute/Base/BGame.h"
#include "engines/wintermute/Base/BRegistry.h"
#include "engines/wintermute/utils/PathUtil.h"
diff --git a/engines/wintermute/Base/BRenderSDL.cpp b/engines/wintermute/Base/BRenderSDL.cpp index 616aa4b944..de4fdddcbc 100644 --- a/engines/wintermute/Base/BRenderSDL.cpp +++ b/engines/wintermute/Base/BRenderSDL.cpp @@ -26,6 +26,11 @@ * Copyright (c) 2011 Jan Nedoma
*/
+#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
+#define FORBIDDEN_SYMBOL_EXCEPTION_fopen
+#define FORBIDDEN_SYMBOL_EXCEPTION_fclose
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+
#include "engines/wintermute/dcgf.h"
#include "engines/wintermute/Base/BRenderSDL.h"
#include "engines/wintermute/Base/BRegistry.h"
diff --git a/engines/wintermute/Base/scriptables/SXFile.cpp b/engines/wintermute/Base/scriptables/SXFile.cpp index c869b6985d..1c6438e217 100644 --- a/engines/wintermute/Base/scriptables/SXFile.cpp +++ b/engines/wintermute/Base/scriptables/SXFile.cpp @@ -26,6 +26,14 @@ * Copyright (c) 2011 Jan Nedoma
*/
+#define FORBIDDEN_SYMBOL_EXCEPTION_fclose
+#define FORBIDDEN_SYMBOL_EXCEPTION_fopen
+#define FORBIDDEN_SYMBOL_EXCEPTION_fwrite
+#define FORBIDDEN_SYMBOL_EXCEPTION_ftell
+#define FORBIDDEN_SYMBOL_EXCEPTION_fseek
+#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+
#include "engines/wintermute/Sys/SysClassRegistry.h"
#include "engines/wintermute/Sys/SysClass.h"
#include "engines/wintermute/Base/scriptables/ScStack.h"
@@ -77,8 +85,8 @@ void CSXFile::Close() { Game->_fileManager->CloseFile(_readFile);
_readFile = NULL;
}
- if (_writeFile) {
- fclose(_writeFile);
+ if ((FILE*)_writeFile) {
+ fclose((FILE*)_writeFile);
_writeFile = NULL;
}
_mode = 0;
@@ -300,9 +308,9 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This return S_OK;
}
if (strcmp(Name, "WriteLine") == 0)
- fprintf(_writeFile, "%s\n", Line);
+ fprintf((FILE*)_writeFile, "%s\n", Line);
else
- fprintf(_writeFile, "%s", Line);
+ fprintf((FILE*)_writeFile, "%s", Line);
Stack->PushBool(true);
@@ -449,7 +457,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, _writeFile);
+ fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
Stack->PushBool(true);
return S_OK;
@@ -467,7 +475,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, _writeFile);
+ fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
Stack->PushBool(true);
return S_OK;
@@ -485,7 +493,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, _writeFile);
+ fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
Stack->PushBool(true);
return S_OK;
@@ -503,7 +511,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, _writeFile);
+ fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
Stack->PushBool(true);
return S_OK;
@@ -521,7 +529,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, _writeFile);
+ fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
Stack->PushBool(true);
return S_OK;
@@ -539,7 +547,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This Stack->PushBool(false);
return S_OK;
}
- fwrite(&Val, sizeof(Val), 1, _writeFile);
+ fwrite(&Val, sizeof(Val), 1, (FILE*)_writeFile);
Stack->PushBool(true);
return S_OK;
@@ -559,8 +567,8 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This }
uint32 Size = strlen(Val);
- fwrite(&Size, sizeof(Size), 1, _writeFile);
- fwrite(Val, Size, 1, _writeFile);
+ fwrite(&Size, sizeof(Size), 1, (FILE*)_writeFile);
+ fwrite(Val, Size, 1, (FILE*)_writeFile);
Stack->PushBool(true);
@@ -653,14 +661,14 @@ HRESULT CSXFile::ScSetProperty(const char *Name, CScValue *Value) { //////////////////////////////////////////////////////////////////////////
uint32 CSXFile::GetPos() {
if (_mode == 1 && _readFile) return _readFile->pos();
- else if ((_mode == 2 || _mode == 3) && _writeFile) return ftell(_writeFile);
+ else if ((_mode == 2 || _mode == 3) && _writeFile) return ftell((FILE*)_writeFile);
else return 0;
}
//////////////////////////////////////////////////////////////////////////
bool CSXFile::SetPos(uint32 pos, TSeek origin) {
if (_mode == 1 && _readFile) return _readFile->seek(pos, origin);
- else if ((_mode == 2 || _mode == 3) && _writeFile) return fseek(_writeFile, pos, (int)origin) == 0;
+ else if ((_mode == 2 || _mode == 3) && _writeFile) return fseek((FILE*)_writeFile, pos, (int)origin) == 0;
else return false;
}
@@ -668,10 +676,10 @@ bool CSXFile::SetPos(uint32 pos, TSeek origin) { uint32 CSXFile::GetLength() {
if (_mode == 1 && _readFile) return _readFile->size();
else if ((_mode == 2 || _mode == 3) && _writeFile) {
- uint32 CurrentPos = ftell(_writeFile);
- fseek(_writeFile, 0, SEEK_END);
- int Ret = ftell(_writeFile);
- fseek(_writeFile, CurrentPos, SEEK_SET);
+ uint32 CurrentPos = ftell((FILE*)_writeFile);
+ fseek((FILE*)_writeFile, 0, SEEK_END);
+ int Ret = ftell((FILE*)_writeFile);
+ fseek((FILE*)_writeFile, CurrentPos, SEEK_SET);
return Ret;
} else return 0;
}
diff --git a/engines/wintermute/Base/scriptables/SXFile.h b/engines/wintermute/Base/scriptables/SXFile.h index f1c6552a71..91cef4c1c5 100644 --- a/engines/wintermute/Base/scriptables/SXFile.h +++ b/engines/wintermute/Base/scriptables/SXFile.h @@ -48,7 +48,7 @@ public: virtual ~CSXFile();
private:
Common::SeekableReadStream *_readFile;
- FILE *_writeFile;
+ void *_writeFile;
int _mode; // 0..none, 1..read, 2..write, 3..append
bool _textMode;
void Close();
diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp index a2c7e077a0..85451bb150 100644 --- a/engines/wintermute/Base/scriptables/ScEngine.cpp +++ b/engines/wintermute/Base/scriptables/ScEngine.cpp @@ -25,7 +25,10 @@ * http://dead-code.org/redir.php?target=wmelite
* Copyright (c) 2011 Jan Nedoma
*/
-
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+#include <algorithm>
+#include <vector>
+#undef FORBIDDEN_SYMBOL_ALLOW_ALL
#include "engines/wintermute/dcgf.h"
#include "engines/wintermute/Base/scriptables/ScEngine.h"
#include "engines/wintermute/utils/StringUtil.h"
@@ -37,8 +40,7 @@ #include "engines/wintermute/Base/BGame.h"
#include "engines/wintermute/Base/BSound.h"
#include "engines/wintermute/Base/BFileManager.h"
-#include <algorithm>
-#include <vector>
+
namespace WinterMute {
diff --git a/engines/wintermute/Sys/SysClass.cpp b/engines/wintermute/Sys/SysClass.cpp index cd5bff0c8c..308287c436 100644 --- a/engines/wintermute/Sys/SysClass.cpp +++ b/engines/wintermute/Sys/SysClass.cpp @@ -25,6 +25,8 @@ * http://dead-code.org/redir.php?target=wmelite
* Copyright (c) 2011 Jan Nedoma
*/
+#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
+#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
#include "engines/wintermute/persistent.h"
#include "SysInstance.h"
diff --git a/engines/wintermute/utils/utils.cpp b/engines/wintermute/utils/utils.cpp index d1ce280639..c9131608be 100644 --- a/engines/wintermute/utils/utils.cpp +++ b/engines/wintermute/utils/utils.cpp @@ -26,6 +26,8 @@ * Copyright (c) 2011 Jan Nedoma
*/
+#define FORBIDDEN_SYMBOL_EXCEPTION_rand
+
#include "engines/wintermute/dcgf.h"
#include "utils.h"
#include "engines/wintermute/PlatformSDL.h"
diff --git a/engines/wintermute/wintypes.h b/engines/wintermute/wintypes.h index c96b109d07..026dfeab27 100644 --- a/engines/wintermute/wintypes.h +++ b/engines/wintermute/wintypes.h @@ -29,10 +29,10 @@ #ifndef WINTERMUTE_WINTYPES_H
#define WINTERMUTE_WINTYPES_H
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "common/scummsys.h"
//namespace WinterMute {
+
#ifndef __WIN32__
#define WINAPI
@@ -81,8 +81,7 @@ typedef int32 HRESULT; //#define S_FALSE ((HRESULT)1)
#define E_FAIL ((HRESULT)-1)
-
-#endif // !__WIN32__
+#endif __WIN32__
//} // end of namespace WinterMute
|