head 1.2; access; symbols pkgsrc-2017Q1:1.1.0.2 pkgsrc-2017Q1-base:1.1; locks; strict; comment @// @; 1.2 date 2017.04.22.07.29.53; author adam; state dead; branches; next 1.1; commitid syEQ6PYSsUDW6vOz; 1.1 date 2017.02.17.17.09.17; author joerg; state Exp; branches; next ; commitid M30U1p0KH2OfnkGz; desc @@ 1.2 log @v1.8.0 - Fixed bugs in numeral systems. - Fixed bugs related to infinity (Inf). - Fixed bugs related to Not a Number (NaN). - Updated and cleanup documentation. - Cleaned up code structure. - OpenLibm support. @ text @$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 +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); @ 1.1 log @Replacement operators must not be declared inline. Bump revision. @ text @d1 1 a1 1 $NetBSD$ @