Skip to content

Commit

Permalink
COMMON: Move <new> include into scummsys.h.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fuzzie committed Nov 17, 2011
1 parent 51f51a9 commit 5647637
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions backends/platform/bada/portdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <new>

#define M_PI 3.14159265358979323846

Expand Down
1 change: 1 addition & 0 deletions backends/platform/dc/portdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <assert.h>
#include <ctype.h>
#include <math.h>
#include <new>
#ifndef RONIN_TIMER_ACCESS
#define Timer ronin_Timer
#endif
Expand Down
1 change: 1 addition & 0 deletions backends/platform/ds/arm9/source/portdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <stdarg.h>
#include <ctype.h>
#include <math.h>
#include <new>

#define double float

Expand Down
1 change: 1 addition & 0 deletions backends/platform/n64/portdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)))
Expand Down
1 change: 1 addition & 0 deletions backends/platform/psp/portdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <time.h>
#include <ctype.h>
#include <assert.h>
#include <new>

#include <pspkernel.h>
#include <pspdebug.h>
Expand Down
1 change: 1 addition & 0 deletions backends/platform/wince/portdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *));
Expand Down
10 changes: 0 additions & 10 deletions common/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand Down
9 changes: 9 additions & 0 deletions common/scummsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 5647637

Please sign in to comment.