[Scummvm-cvs-logs] scummvm master -> 5647637ea2d239681a9dc0facc4071e33235fe4f

fuzzie fuzzie at fuzzie.org
Thu Nov 17 12:51:21 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5647637ea2 COMMON: Move <new> include into scummsys.h.


Commit: 5647637ea2d239681a9dc0facc4071e33235fe4f
    https://github.com/scummvm/scummvm/commit/5647637ea2d239681a9dc0facc4071e33235fe4f
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-11-17T03:46:44-08:00

Commit Message:
COMMON: Move <new> include into scummsys.h.

The header contains forbidden symbols on some platforms, and the
simplest solution seems to be to include it here. This also includes
it from all the portdefs.h files, except the Symbian one. Probably
the FIXME and the #if can be removed once it's known to work.

Changed paths:
    backends/platform/bada/portdefs.h
    backends/platform/dc/portdefs.h
    backends/platform/ds/arm9/source/portdefs.h
    backends/platform/n64/portdefs.h
    backends/platform/psp/portdefs.h
    backends/platform/wince/portdefs.h
    common/memory.h
    common/scummsys.h



diff --git a/backends/platform/bada/portdefs.h b/backends/platform/bada/portdefs.h
index e85d578..7d85a9e 100644
--- a/backends/platform/bada/portdefs.h
+++ b/backends/platform/bada/portdefs.h
@@ -30,6 +30,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <math.h>
+#include <new>
 
 #define M_PI 3.14159265358979323846
 
diff --git a/backends/platform/dc/portdefs.h b/backends/platform/dc/portdefs.h
index ca2b520..1f5c8f5 100644
--- a/backends/platform/dc/portdefs.h
+++ b/backends/platform/dc/portdefs.h
@@ -29,6 +29,7 @@
 #include <assert.h>
 #include <ctype.h>
 #include <math.h>
+#include <new>
 #ifndef RONIN_TIMER_ACCESS
 #define Timer ronin_Timer
 #endif
diff --git a/backends/platform/ds/arm9/source/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h
index f512ce3..e40849a 100644
--- a/backends/platform/ds/arm9/source/portdefs.h
+++ b/backends/platform/ds/arm9/source/portdefs.h
@@ -37,6 +37,7 @@
 #include <stdarg.h>
 #include <ctype.h>
 #include <math.h>
+#include <new>
 
 #define double float
 
diff --git a/backends/platform/n64/portdefs.h b/backends/platform/n64/portdefs.h
index 677ad48..10f5ed6 100644
--- a/backends/platform/n64/portdefs.h
+++ b/backends/platform/n64/portdefs.h
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <math.h>
+#include <new>
 
 #undef assert
 #define assert(x)  ((x) ? 0 : (print_error("ASSERT TRIGGERED:\n\n("#x")\n%s\nline: %d", __FILE__, __LINE__)))
diff --git a/backends/platform/psp/portdefs.h b/backends/platform/psp/portdefs.h
index e8a28b3..620a27a 100644
--- a/backends/platform/psp/portdefs.h
+++ b/backends/platform/psp/portdefs.h
@@ -38,6 +38,7 @@
 #include <time.h>
 #include <ctype.h>
 #include <assert.h>
+#include <new>
 
 #include <pspkernel.h>
 #include <pspdebug.h>
diff --git a/backends/platform/wince/portdefs.h b/backends/platform/wince/portdefs.h
index 93df6cd..289406c 100644
--- a/backends/platform/wince/portdefs.h
+++ b/backends/platform/wince/portdefs.h
@@ -73,6 +73,7 @@
 #include <mmsystem.h>
 #include <ctype.h>
 //#include <direct.h>
+#include <new>
 
 #ifdef __MINGW32CE__
 	void *bsearch(const void *, const void *, size_t, size_t, int (*x)(const void *, const void *));
diff --git a/common/memory.h b/common/memory.h
index 1870850..0e5a97c 100644
--- a/common/memory.h
+++ b/common/memory.h
@@ -24,16 +24,6 @@
 
 #include "common/scummsys.h"
 
-// FIXME: We sadly can't assume standard C++ headers to be present on every
-// system we support, so we should get rid of this. The solution should be to
-// write a simple placement new on our own. It might be noteworthy we can't
-// easily do that for systems which do have a <new>, since it might clash with
-// the default definition otherwise!
-// Symbian does not have <new> but the new operator 
-#if !defined(__SYMBIAN32__) 
-#include <new>
-#endif
-
 namespace Common {
 
 /**
diff --git a/common/scummsys.h b/common/scummsys.h
index fbd5bb5..6baab7c 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -130,6 +130,15 @@
 	#define _USE_MATH_DEFINES
 	#include <math.h>
 
+	// FIXME: We sadly can't assume standard C++ headers to be present on every
+	// system we support, so we should get rid of this. The solution should be to
+	// write a simple placement new on our own. It might be noteworthy we can't
+	// easily do that for systems which do have a <new>, since it might clash with
+	// the default definition otherwise!
+	// Symbian does not have <new> but the new operator
+	#if !defined(__SYMBIAN32__)
+	#include <new>
+	#endif
 #endif
 
 






More information about the Scummvm-git-logs mailing list