diff options
Diffstat (limited to 'debianbuild/patches/03-g++-new-throws.dpatch')
-rw-r--r-- | debianbuild/patches/03-g++-new-throws.dpatch | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/debianbuild/patches/03-g++-new-throws.dpatch b/debianbuild/patches/03-g++-new-throws.dpatch new file mode 100644 index 00000000000..54f3b631ae9 --- /dev/null +++ b/debianbuild/patches/03-g++-new-throws.dpatch @@ -0,0 +1,68 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03-g++-new-throws.dpatch by Thomas Girard <thomas.g.girard@free.fr> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: don't test if new() throws std::bad_alloc + +@DPATCH@ +--- orig/configure.ac ++++ mod/configure.ac +@@ -5224,57 +5224,7 @@ + ACE_CACHE_CHECK([if new throws std::bad_alloc exception on failure], + [ace_cv_new_throws_bad_alloc_exception], + [ +- AC_RUN_IFELSE([AC_LANG_SOURCE([[ +-#if defined (ACE_HAS_NEW_NO_H) +-# include <new> +-#elif defined (ACE_HAS_NEW_H) +-# include <new.h> +-#endif +- +-#if defined (ACE_HAS_STDEXCEPT_NO_H) +-# include <stdexcept> +-#elif defined (ACE_HAS_EXCEPTION_H) +-# include <exception.h> +-#endif +- +-/* We already checked for ACE_LACKS_NUMERIC_LIMITS */ +-#if !defined ACE_LACKS_NUMERIC_LIMITS +-#include <limits> +-#endif +- +- int main(int, char *[]) { +-#if defined ACE_LACKS_NUMERIC_LIMITS +- const size_t ALLOC_SIZE = 2 * 1024 * 1024 * 1024; +-#else +- const size_t ALLOC_SIZE = std::numeric_limits<size_t>::max () / 2; +-#endif +- while (1) { +- try { +- char *a = new char[ALLOC_SIZE]; +- if (a == 0) { +- return 1; /* new() does NOT throw exceptions */ +- } +- } +- +-#ifdef ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB +- catch (std::bad_alloc) +-#else +- catch (bad_alloc) +-#endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ +- { +- return 0; /* new() does throw exceptions */ +- } +- }; +- +- return 1; /* ERROR: We shouldn't get this far! */ +- } +- ]])],[ +- ace_cv_new_throws_bad_alloc_exception=yes +- ],[ +- ace_cv_new_throws_bad_alloc_exception=no +- ],[ +- ace_cv_new_throws_bad_alloc_exception=no +- ]) ++ ace_cv_new_throws_bad_alloc_exception=yes + ], [AC_DEFINE([ACE_NEW_THROWS_EXCEPTIONS])],) + + if test "$ace_cv_new_throws_bad_alloc_exception" != yes; then |