diff options
author | joerg <joerg@pkgsrc.org> | 2017-02-17 17:09:16 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2017-02-17 17:09:16 +0000 |
commit | a1894994f3679a862f5a32d5a2314bebb82d2e9a (patch) | |
tree | e8584503848cb89f27bb4966fd82c1ae891e2b26 | |
parent | 8008f73320e7a7c41ea27419952fef4975b7d843 (diff) | |
download | pkgsrc-a1894994f3679a862f5a32d5a2314bebb82d2e9a.tar.gz |
Replacement operators must not be declared inline. Bump revision.
-rw-r--r-- | math/amath/Makefile | 3 | ||||
-rw-r--r-- | math/amath/distinfo | 4 | ||||
-rw-r--r-- | math/amath/patches/patch-app_main.cpp | 50 | ||||
-rw-r--r-- | math/amath/patches/patch-lib_platform.h | 58 |
4 files changed, 113 insertions, 2 deletions
diff --git a/math/amath/Makefile b/math/amath/Makefile index 06c9db114aa..576f2f40221 100644 --- a/math/amath/Makefile +++ b/math/amath/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.1 2017/01/30 19:49:26 leot Exp $ +# $NetBSD: Makefile,v 1.2 2017/02/17 17:09:16 joerg Exp $ DISTNAME= amath-1.6.2 +PKGREVISION= 1 CATEGORIES= math MASTER_SITES= http://suyai.innolan.net/ diff --git a/math/amath/distinfo b/math/amath/distinfo index 1b557b01df2..9df4fa4224c 100644 --- a/math/amath/distinfo +++ b/math/amath/distinfo @@ -1,6 +1,8 @@ -$NetBSD: distinfo,v 1.1 2017/01/30 19:49:26 leot Exp $ +$NetBSD: distinfo,v 1.2 2017/02/17 17:09:16 joerg Exp $ SHA1 (amath-1.6.2.tar.gz) = 9efdf46ddb70128d920abd92c20c65c3ef700f00 RMD160 (amath-1.6.2.tar.gz) = 101b5692ac6f77d0e05edff52736f4587b0313e2 SHA512 (amath-1.6.2.tar.gz) = f05691da9930a209224846a014a5cb19b5c7ea1ac0a5b73db5f74905f741d800b3b4ddf5df0a8caceed15b291bd327a6bb1ff72b68764c269fa08c1ed427390b Size (amath-1.6.2.tar.gz) = 494838 bytes +SHA1 (patch-app_main.cpp) = 52427c8a29cbe8f1c0157acbff48dc786baa88d8 +SHA1 (patch-lib_platform.h) = 0b97085d673cd2b077a0bcc5db8a4c253d7f0bea 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); diff --git a/math/amath/patches/patch-lib_platform.h b/math/amath/patches/patch-lib_platform.h new file mode 100644 index 00000000000..786928c0c8a --- /dev/null +++ b/math/amath/patches/patch-lib_platform.h @@ -0,0 +1,58 @@ +$NetBSD: patch-lib_platform.h,v 1.1 2017/02/17 17:09:17 joerg Exp $ + +Replace operators must be global. + +--- lib/platform.h.orig 2017-02-17 12:09:25.174210005 +0000 ++++ lib/platform.h +@@ -138,21 +138,10 @@ typedef u_int32_t uint32_t; + typedef u_int64_t uint64_t; + # define IPTR LONG* + #ifdef __cplusplus +-inline void* operator new (size_t size) { +- return AllocMemSafe(size); +-} +- +-inline void* operator new[] (size_t size) { +- return AllocMemSafe(size); +-} +- +-inline void operator delete (void* ptr) { +- FreeMemSafe(ptr); +-} +- +-inline void operator delete[] (void* ptr) { +- FreeMemSafe(ptr); +-} ++void* operator new (size_t size); ++void* operator new[] (size_t size); ++void operator delete (void* ptr); ++void operator delete[] (void* ptr); + #endif + #endif + +@@ -164,21 +153,10 @@ inline void operator delete[] (void* pt + #ifdef __cplusplus + #if (__GNUC__ > 2) || defined (_WIN32) + #include <new> +-inline void* operator new (size_t size) throw(std::bad_alloc) { +- return AllocMemSafe(size); +-} +- +-inline void* operator new[] (size_t size) throw(std::bad_alloc) { +- return AllocMemSafe(size); +-} +- +-inline void operator delete (void* ptr) throw() { +- FreeMemSafe(ptr); +-} +- +-inline void operator delete[] (void* ptr) throw() { +- FreeMemSafe(ptr); +-} ++void* operator new (size_t size) throw(std::bad_alloc); ++void* operator new[] (size_t size) throw(std::bad_alloc); ++void operator delete (void* ptr) throw(); ++void operator delete[] (void* ptr) throw(); + #endif + #endif + |