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

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


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

commit 06d4d1ca0f536cdc52f7bde77dbcde0a83ff2e2a
Author: Jim Jagielski <[email protected]>
AuthorDate: Fri Aug 7 07:33:40 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 by an actual product-build
    rebuild of AOO42X after picking a3755bb196; trunk has the same bug.
---
 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