diff options
author | joerg <joerg> | 2017-02-17 17:09:16 +0000 |
---|---|---|
committer | joerg <joerg> | 2017-02-17 17:09:16 +0000 |
commit | cd0c0485abb0561b5fb40b61b0716004d9841533 (patch) | |
tree | e8584503848cb89f27bb4966fd82c1ae891e2b26 /math/amath/patches/patch-app_main.cpp | |
parent | a370f0c4836be16fc636cc9cb8b2dce90b3165fa (diff) | |
download | pkgsrc-cd0c0485abb0561b5fb40b61b0716004d9841533.tar.gz |
Replacement operators must not be declared inline. Bump revision.
Diffstat (limited to 'math/amath/patches/patch-app_main.cpp')
-rw-r--r-- | math/amath/patches/patch-app_main.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/math/amath/patches/patch-app_main.cpp b/math/amath/patches/patch-app_main.cpp new file mode 100644 index 00000000000..1fe5521a801 --- /dev/null +++ b/math/amath/patches/patch-app_main.cpp @@ -0,0 +1,50 @@ +$NetBSD: patch-app_main.cpp,v 1.1 2017/02/17 17:09:17 joerg Exp $ + +Replace operators must be global. + +--- app/main.cpp.orig 2017-02-17 12:12:18.536908981 +0000 ++++ app/main.cpp +@@ -27,6 +27,43 @@ + #include "system/program.h" + #include "system/base/io.h" + ++#if (__GNUC__ == 2 && __GNUC_MINOR__ == 95) ++void* operator new (size_t size) { ++ return AllocMemSafe(size); ++} ++ ++void* operator new[] (size_t size) { ++ return AllocMemSafe(size); ++} ++ ++void operator delete (void* ptr) { ++ FreeMemSafe(ptr); ++} ++ ++void operator delete[] (void* ptr) { ++ FreeMemSafe(ptr); ++} ++#endif ++ ++#if (__GNUC__ > 2) || defined (_WIN32) ++#include <new> ++void* operator new (size_t size) throw(std::bad_alloc) { ++ return AllocMemSafe(size); ++} ++ ++void* operator new[] (size_t size) throw(std::bad_alloc) { ++ return AllocMemSafe(size); ++} ++ ++void operator delete (void* ptr) throw() { ++ FreeMemSafe(ptr); ++} ++ ++void operator delete[] (void* ptr) throw() { ++ FreeMemSafe(ptr); ++} ++#endif ++ + int main(int argc, char **argv) + { + Program = CreateProgram(argc, argv); |