This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch compilers-101
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 533e4e54722cdc10c191804702afe4beed1fd4a5
Author: Pedro F. Giffuni <[email protected]>
AuthorDate: Fri Nov 6 19:36:47 2026 -0500

    Fix C++17 build failures on FreeBSD
    
    - bridges/source/jni_uno/jni_base.h, jni_uno2java.cxx, jni_helper.h, 
jni_data.cxx, jni_bridge.cxx:
      Replace std::auto_ptr<rtl_mem> with std::unique_ptr<rtl_mem> (auto_ptr 
removed in C++17)
    - basegfx/source/range/b2drangeclipper.cxx:
      Change isSameRect first parameter to const ActiveEdge& (lambda passes 
const ref)
    - comphelper/source/property/property.cxx:
      Dereference prop pointer in lambda (functor expects Property&, not 
Property*)
---
 main/basegfx/source/range/b2drangeclipper.cxx |  2 +-
 main/bridges/source/jni_uno/jni_base.h        |  6 +++---
 main/bridges/source/jni_uno/jni_bridge.cxx    |  4 ++--
 main/bridges/source/jni_uno/jni_data.cxx      | 14 +++++++-------
 main/bridges/source/jni_uno/jni_helper.h      |  2 +-
 main/bridges/source/jni_uno/jni_uno2java.cxx  |  2 +-
 main/comphelper/source/property/property.cxx  |  2 +-
 7 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/main/basegfx/source/range/b2drangeclipper.cxx 
b/main/basegfx/source/range/b2drangeclipper.cxx
index 084efb99b4..9f07beeb7b 100644
--- a/main/basegfx/source/range/b2drangeclipper.cxx
+++ b/main/basegfx/source/range/b2drangeclipper.cxx
@@ -733,7 +733,7 @@ namespace basegfx
                                  aNewEdges );
         }
 
-        inline bool isSameRect(ActiveEdge&              rEdge,
+        inline bool isSameRect(const ActiveEdge&         rEdge,
                                const basegfx::B2DRange& rRect)
         {
             return &rEdge.getRect() == &rRect;
diff --git a/main/bridges/source/jni_uno/jni_base.h 
b/main/bridges/source/jni_uno/jni_base.h
index 47d12b63d2..d021c66802 100644
--- a/main/bridges/source/jni_uno/jni_base.h
+++ b/main/bridges/source/jni_uno/jni_base.h
@@ -240,16 +240,16 @@ struct rtl_mem
        inline static void operator delete ( void *, void * )
                {}
 
-    static inline ::std::auto_ptr< rtl_mem > allocate( ::std::size_t bytes );
+    static inline ::std::unique_ptr< rtl_mem > allocate( ::std::size_t bytes );
 };
 
 
//______________________________________________________________________________
-inline ::std::auto_ptr< rtl_mem > rtl_mem::allocate( ::std::size_t bytes )
+inline ::std::unique_ptr< rtl_mem > rtl_mem::allocate( ::std::size_t bytes )
 {
     void * p = rtl_allocateMemory( bytes );
     if (0 == p)
         throw BridgeRuntimeError( OUSTR("out of memory!") );
-    return ::std::auto_ptr< rtl_mem >( (rtl_mem *)p );
+    return ::std::unique_ptr< rtl_mem >( (rtl_mem *)p );
 }
 
 
diff --git a/main/bridges/source/jni_uno/jni_bridge.cxx 
b/main/bridges/source/jni_uno/jni_bridge.cxx
index e6f55d8ff8..6c95133405 100644
--- a/main/bridges/source/jni_uno/jni_bridge.cxx
+++ b/main/bridges/source/jni_uno/jni_bridge.cxx
@@ -334,7 +334,7 @@ void JNI_context::java_exc_occured() const
     }
 
     jsize len = m_env->GetStringLength( (jstring) jo_descr.get() );
-    auto_ptr< rtl_mem > ustr_mem(
+    std::unique_ptr< rtl_mem > ustr_mem(
         rtl_mem::allocate(
             sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) ) );
     rtl_uString * ustr = (rtl_uString *)ustr_mem.get();
@@ -410,7 +410,7 @@ OUString JNI_context::get_stack_trace( jobject jo_exc ) 
const
             {
                 jsize len =
                     m_env->GetStringLength( (jstring) jo_stack_trace.get() );
-                auto_ptr< rtl_mem > ustr_mem(
+                std::unique_ptr< rtl_mem > ustr_mem(
                     rtl_mem::allocate(
                         sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) ) 
);
                 rtl_uString * ustr = (rtl_uString *)ustr_mem.get();
diff --git a/main/bridges/source/jni_uno/jni_data.cxx 
b/main/bridges/source/jni_uno/jni_data.cxx
index 77611feee0..0176965bcc 100644
--- a/main/bridges/source/jni_uno/jni_data.cxx
+++ b/main/bridges/source/jni_uno/jni_data.cxx
@@ -40,7 +40,7 @@ namespace jni_uno
 
//------------------------------------------------------------------------------
 inline rtl_mem * seq_allocate( sal_Int32 nElements, sal_Int32 nSize )
 {
-    auto_ptr< rtl_mem > seq(
+    std::unique_ptr< rtl_mem > seq(
         rtl_mem::allocate( SAL_SEQUENCE_HEADER_SIZE + (nElements * nSize) ) );
     uno_Sequence * p = (uno_Sequence *)seq.get();
     p->nRefCount = 1;
@@ -132,7 +132,7 @@ void createDefaultUnoValue(
 
     case typelib_TypeClass_SEQUENCE:
         {
-            auto_ptr< rtl_mem > seq(seq_allocate(0, 0));
+            std::unique_ptr< rtl_mem > seq(seq_allocate(0, 0));
             if (assign) {
                 uno_type_destructData(uno_data, type, 0);
             }
@@ -599,7 +599,7 @@ void Bridge::map_to_uno(
                 }
                 else
                 {
-                    auto_ptr< rtl_mem > mem(
+                    std::unique_ptr< rtl_mem > mem(
                         rtl_mem::allocate( sizeof (sal_Int64) ) );
                     *(jlong *) mem.get() = jni->CallLongMethodA(
                         java_data.l, m_jni_info->m_method_Long_longValue, 0 );
@@ -617,7 +617,7 @@ void Bridge::map_to_uno(
                 }
                 else
                 {
-                    auto_ptr< rtl_mem > mem(
+                    std::unique_ptr< rtl_mem > mem(
                         rtl_mem::allocate( sizeof (float) ) );
                     *(jfloat *) mem.get() = jni->CallFloatMethodA(
                         java_data.l, m_jni_info->m_method_Float_floatValue, 0 
);
@@ -637,7 +637,7 @@ void Bridge::map_to_uno(
                 }
                 else
                 {
-                    auto_ptr< rtl_mem > mem(
+                    std::unique_ptr< rtl_mem > mem(
                         rtl_mem::allocate( sizeof (double) ) );
                     *(jdouble *) mem.get() =
                         jni->CallDoubleMethodA(
@@ -668,7 +668,7 @@ void Bridge::map_to_uno(
             case typelib_TypeClass_STRUCT:
             case typelib_TypeClass_EXCEPTION:
             {
-                auto_ptr< rtl_mem > mem(
+                std::unique_ptr< rtl_mem > mem(
                     rtl_mem::allocate( value_td.get()->nSize ) );
                 map_to_uno(
                     jni, mem.get(), java_data, value_td.get()->pWeakRef, 0,
@@ -1023,7 +1023,7 @@ void Bridge::map_to_uno(
         typelib_TypeDescriptionReference * element_type =
             ((typelib_IndirectTypeDescription *)td.get())->pType;
 
-        auto_ptr< rtl_mem > seq;
+        std::unique_ptr< rtl_mem > seq;
         sal_Int32 nElements = jni->GetArrayLength( (jarray) java_data.l );
 
         switch (element_type->eTypeClass)
diff --git a/main/bridges/source/jni_uno/jni_helper.h 
b/main/bridges/source/jni_uno/jni_helper.h
index 7cfde82f18..271f1be59f 100644
--- a/main/bridges/source/jni_uno/jni_helper.h
+++ b/main/bridges/source/jni_uno/jni_helper.h
@@ -42,7 +42,7 @@ inline void jstring_to_ustring(
     else
     {
         jsize len = jni->GetStringLength( jstr );
-        ::std::auto_ptr< rtl_mem > mem(
+        ::std::unique_ptr< rtl_mem > mem(
             rtl_mem::allocate(
                 sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) ) );
         rtl_uString * ustr = (rtl_uString *)mem.get();
diff --git a/main/bridges/source/jni_uno/jni_uno2java.cxx 
b/main/bridges/source/jni_uno/jni_uno2java.cxx
index f0724b9769..72fca0cc9a 100644
--- a/main/bridges/source/jni_uno/jni_uno2java.cxx
+++ b/main/bridges/source/jni_uno/jni_uno2java.cxx
@@ -101,7 +101,7 @@ void Bridge::handle_java_exc(
         throw BridgeRuntimeError( buf.makeStringAndClear() );
     }
 
-    auto_ptr< rtl_mem > uno_data( rtl_mem::allocate( td.get()->nSize ) );
+    std::unique_ptr< rtl_mem > uno_data( rtl_mem::allocate( td.get()->nSize ) 
);
     jvalue val;
     val.l = jo_exc.get();
     map_to_uno(
diff --git a/main/comphelper/source/property/property.cxx 
b/main/comphelper/source/property/property.cxx
index c6ab03d807..8d9fa38ef3 100644
--- a/main/comphelper/source/property/property.cxx
+++ b/main/comphelper/source/property/property.cxx
@@ -157,7 +157,7 @@ bool findProperty(Property&              o_rProp,
     const sal_Int32 nLen(i_seqProps.getLength());
     const Property* pRes(
         std::find_if(pAry,pAry+nLen,
-                      [&](const auto* prop) { return 
PropertyStringEqualFunctor()(prop, i_rPropName); }));
+                      [&](const auto* prop) { return 
PropertyStringEqualFunctor()(*prop, i_rPropName); }));
     if( pRes == pAry+nLen )
         return false;
 

Reply via email to