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

jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new ee5121da92 ustring.c: gate the mixed UTF-16/ASCII NULL guards behind 
OSL_DEBUG_LEVEL
ee5121da92 is described below

commit ee5121da92cb9fa76cc1dba8422013fb0ffc4842
Author: Jim Jagielski <[email protected]>
AuthorDate: Fri Aug 7 07:35:34 2026 -0400

    ustring.c: gate the mixed UTF-16/ASCII NULL guards behind OSL_DEBUG_LEVEL
    
    strtmpl.c's aImplGuardEmptyStr, which these macros reference, only exists
    under OSL_DEBUG_LEVEL > 0. Without a matching guard here, a product build
    fails: "use of undeclared identifier 'aImplGuardEmptyStr'". Mirrors
    strtmpl.c's own #if/#else pattern. Found rebuilding AOO42X in product
    configuration after picking this same fix (f0853378f1) there.
---
 main/sal/rtl/source/ustring.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/main/sal/rtl/source/ustring.c b/main/sal/rtl/source/ustring.c
index ca51caf235..1de567b751 100644
--- a/main/sal/rtl/source/ustring.c
+++ b/main/sal/rtl/source/ustring.c
@@ -161,6 +161,8 @@ double SAL_CALL rtl_ustr_toDouble(sal_Unicode const * pStr)
 /* guards are at function entry, outside the per-character loops.          */
 /* ======================================================================= */
 
+#if OSL_DEBUG_LEVEL > 0
+
 static const sal_Char aImplGuardEmptyAscii = 0;
 
 /* Null-terminated ASCII argument: treat NULL as the empty string. */
@@ -198,6 +200,14 @@ static const sal_Char aImplGuardEmptyAscii = 0;
         }                                                                   \
     } while (0)
 
+#else /* product build: guards compile away, callers must honour contract */
+
+#define IMPL_RTL_ASCII_NULL_AS_EMPTY( pAscii )        ((void)0)
+#define IMPL_RTL_UNI_NULL_AS_EMPTY( pUni )            ((void)0)
+#define IMPL_RTL_UNI_NULL_AS_EMPTY_LEN( pUni, nLen )  ((void)0)
+
+#endif
+
 sal_Int32 SAL_CALL rtl_ustr_ascii_compare( const sal_Unicode* pStr1,
                                            const sal_Char* pStr2 )
 {

Reply via email to