changeset 30501:79a7f3e3cf54 stable

Use consistent name for OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR (bug #61472). * libinterp/corefcn/mex.cc, liboctave/array/Array-fwd.h, liboctave/array/Array.h, m4/acinclude.m4: Use consistent name for new pre-processor variable everywhere. Fix typo. Remove debug messages.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 16 Dec 2021 22:01:14 +0100
parents 225971ac0938
children 6e8a4dacc014 838e73617671
files libinterp/corefcn/mex.cc liboctave/array/Array-fwd.h liboctave/array/Array.h m4/acinclude.m4
diffstat 4 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/mex.cc	Thu Dec 16 21:11:47 2021 +0100
+++ b/libinterp/corefcn/mex.cc	Thu Dec 16 22:01:14 2021 +0100
@@ -27,7 +27,7 @@
 #  include "config.h"
 #endif
 
-#define DEBUG 1
+// #define DEBUG 1
 
 #if defined (DEBUG)
 #  include <iostream>
@@ -40,7 +40,7 @@
 
 #include <limits>
 #include <map>
-#if defined (HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
+#if defined (OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
 #  include <memory_resource>
 #endif
 #include <set>
@@ -338,7 +338,7 @@
   static const bool is_complex = true;
 };
 
-#if defined (HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
+#if defined (OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
 
 class mx_memory_resource : public std::pmr::memory_resource
 {
@@ -2142,7 +2142,7 @@
 
     ELT_T *ppr = static_cast<ELT_T *> (m_pr);
 
-#if defined (HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
+#if defined (OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
 
     octave::unwind_action act ([=] () { maybe_disown_ptr (m_pr); });
 
@@ -2189,7 +2189,7 @@
 
     ELT_T *ppr = static_cast<ELT_T *> (m_pr);
 
-#if 0 && defined (HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
+#if 0 && defined (OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
 
     octave::unwind_action act ([=] () { maybe_disown_ptr (m_pr); });
 
--- a/liboctave/array/Array-fwd.h	Thu Dec 16 21:11:47 2021 +0100
+++ b/liboctave/array/Array-fwd.h	Thu Dec 16 22:01:14 2021 +0100
@@ -28,7 +28,7 @@
 
 #include "octave-config.h"
 
-#if defined (HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
+#if defined (OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
 #  include <memory_resource>
 
 template <typename T, typename Alloc = std::pmr::polymorphic_allocator<T>>
--- a/liboctave/array/Array.h	Thu Dec 16 21:11:47 2021 +0100
+++ b/liboctave/array/Array.h	Thu Dec 16 22:01:14 2021 +0100
@@ -789,7 +789,7 @@
 
   //! Apply function fcn to each element of the Array<T, Alloc>.  This function
   //! is optimized with a manually unrolled loop.
-#if defined (HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
+#if defined (OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
   template <typename U, typename F,
             typename A = std::pmr::polymorphic_allocator<U>>
 #else
@@ -826,7 +826,7 @@
 
   //@{
   //! Overloads for function references.
-#if defined (HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
+#if defined (OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
   template <typename U, typename A = std::pmr::polymorphic_allocator<U>>
 #else
   template <typename U, typename A = std::allocator<U>>
@@ -835,7 +835,7 @@
   map (U (&fcn) (T)) const
   { return map<U, U (&) (T), A> (fcn); }
 
-#if defined (HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
+#if defined (OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR)
   template <typename U, typename A = std::pmr::polymorphic_allocator<U>>
 #else
   template <typename U, typename A = std::allocator<U>>
--- a/m4/acinclude.m4	Thu Dec 16 21:11:47 2021 +0100
+++ b/m4/acinclude.m4	Thu Dec 16 22:01:14 2021 +0100
@@ -258,7 +258,7 @@
 dnl Check whether std::pmr::polymorphic_allocator is available.
 dnl
 AC_DEFUN([OCTAVE_CHECK_STD_PMR_POLYMORPHIC_ALLOCATOR], [
-  AC_CACHE_CHECK([whether std::pmr::polymorphic_allocator is avalable],
+  AC_CACHE_CHECK([whether std::pmr::polymorphic_allocator is available],
     [octave_cv_std_pmr_polymorphic_allocator],
     [AC_LANG_PUSH(C++)
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@@ -295,7 +295,7 @@
     AC_LANG_POP(C++)
   ])
   if test $octave_cv_std_pmr_polymorphic_allocator = yes; then
-    AC_DEFINE(HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR, 1,
+    AC_DEFINE(OCTAVE_HAVE_STD_PMR_POLYMORPHIC_ALLOCATOR, 1,
       [Define to 1 if std::pmr::polymorphic_allocator is available.])
   fi
 ])