aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-09-18 18:22:15 +0000
committerMax Horn2003-09-18 18:22:15 +0000
commit209413ed07e931277cf569d260fbfad71406088e (patch)
treeba13e66babf87dd172366826d292754ba9f5417d
parentf8997ba7cc7cdc59a5f04f13fbabdd0d0114a42c (diff)
downloadscummvm-rg350-209413ed07e931277cf569d260fbfad71406088e.tar.gz
scummvm-rg350-209413ed07e931277cf569d260fbfad71406088e.tar.bz2
scummvm-rg350-209413ed07e931277cf569d260fbfad71406088e.zip
disable the custom operator 'new' on Mac OS X, as it cause multiple definition linker error when building ScummVM with loadable modules
svn-id: r10303
-rw-r--r--base/main.cpp2
-rw-r--r--common/scummsys.h29
2 files changed, 16 insertions, 15 deletions
diff --git a/base/main.cpp b/base/main.cpp
index 8bcbafc97c..247fcb9f9d 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -290,7 +290,7 @@ int main(int argc, char *argv[]) {
return 0;
}
-#ifndef __PALM_OS__
+#if !defined(__PALM_OS__) && !defined(MACOSX)
void *operator new(size_t size) {
return memset(malloc(size), 0xE7, size);
}
diff --git a/common/scummsys.h b/common/scummsys.h
index b08f520aa6..ff087b289b 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -383,20 +383,21 @@ FORCEINLINE uint16 SWAP_BYTES_16(uint16 a) {
typedef int16 NewGuiColor;
#endif
-/* Initialized operator new */
-// FIXME - get rid of these new/delete overrides!!! They conflict with the
-// Standard C++ library, and they are only there to support lazy programmers anyway.
-#ifndef __PALM_OS__
-void * operator new(size_t size);
-void operator delete(void *ptr);
-// Temporary hack until we fully remove the new/delete operators:
-// Since 'new' now returns a memory block inited to 0xE7E7E7E7 we might
-// get some invocations of free() with that param. We check for those here.
-// That allows us to set a debugger breakpoint to catch it.
-#ifndef _WIN32_WCE
-#define free(x) free_check(x)
-void free_check(void *ptr);
-#endif
+#if !defined(__PALM_OS__) && !defined(MACOSX)
+ /* Initialized operator new */
+ // FIXME - get rid of these new/delete overrides!!! They conflict with the
+ // Standard C++ library, and they are only there to support lazy programmers anyway.
+ void * operator new(size_t size);
+ void operator delete(void *ptr);
+
+ // Temporary hack until we fully remove the new/delete operators:
+ // Since 'new' now returns a memory block inited to 0xE7E7E7E7 we might
+ // get some invocations of free() with that param. We check for those here.
+ // That allows us to set a debugger breakpoint to catch it.
+ #ifndef _WIN32_WCE
+ #define free(x) free_check(x)
+ void free_check(void *ptr);
+ #endif
#endif
#endif