external/afdko/UnpackedTarball_afdko.mk |    1 +
 external/afdko/extern_makeotf.patch     |   23 +++++++++++++++++++++++
 external/afdko/extern_tx_shared.patch   |   23 +++++++++++++++++++++++
 vcl/source/gdi/afdko.hxx                |    3 ++-
 4 files changed, 49 insertions(+), 1 deletion(-)

New commits:
commit 254a1e39ee84bc81822be385a6135f37d12c9de8
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Sep 26 11:32:50 2025 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Oct 14 17:14:01 2025 +0200

    fix build for system libxml that includes icu case
    
    workdir/UnpackedTarball/icu/source/common/unicode/localpointer.h:67:1: 
error: template with C linkage
    
    Change-Id: I08b0766a7b7a345bbb8b09bc191ecd16212400ac
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191537
    Reviewed-by: Caolán McNamara <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Caolán McNamara <[email protected]>
    (cherry picked from commit 56ae90c7f8c804a353f1de8508f2b0471fb44c1e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192334
    Tested-by: Jenkins

diff --git a/external/afdko/UnpackedTarball_afdko.mk 
b/external/afdko/UnpackedTarball_afdko.mk
index 98426c76d379..1c23879dcc5f 100644
--- a/external/afdko/UnpackedTarball_afdko.mk
+++ b/external/afdko/UnpackedTarball_afdko.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,afdko,1))
 
 $(eval $(call gb_UnpackedTarball_add_patches,afdko, \
     external/afdko/extern_tx.patch \
+    external/afdko/extern_tx_shared.patch \
     external/afdko/extern_mergefonts.patch \
     external/afdko/extern_makeotf.patch \
     external/afdko/warnings.patch \
diff --git a/external/afdko/extern_makeotf.patch 
b/external/afdko/extern_makeotf.patch
index 1f4e5cfa0b55..fd827b0f0ceb 100644
--- a/external/afdko/extern_makeotf.patch
+++ b/external/afdko/extern_makeotf.patch
@@ -300,3 +300,26 @@
  #include "cb.h"
  
  extern void myfatal(void *ctx);
+--- afdko/c/makeotf/source/cb.h
++++ afdko/c/makeotf/source/cb.h
+@@ -8,6 +8,11 @@
+ 
+ #include <stddef.h>
+ #include "dynarr.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ typedef struct cbCtx_ *cbCtx;
+ 
+ /* Define to supply Microsoft-specific function calling info, e.g. __cdecl */
+@@ -80,4 +85,8 @@
+ #define OTHERFLAGS_VERBOSE (1 << 15)
+ #define OTHERFLAGS_FINAL_NAMES (1 << 16)
+ 
++#ifdef __cplusplus
++}
++#endif
++
+ #endif /* CB_H */
diff --git a/external/afdko/extern_tx_shared.patch 
b/external/afdko/extern_tx_shared.patch
new file mode 100644
index 000000000000..b06cec02774f
--- /dev/null
+++ b/external/afdko/extern_tx_shared.patch
@@ -0,0 +1,23 @@
+--- afdko/c/shared/include/tx_shared.h
++++ afdko/c/shared/include/tx_shared.h
+@@ -86,6 +86,11 @@
+ #define sig_UFO CTL_TAG('<', '?', 'x', 'm')
+ /* Generate n-bit mask */
+ #define N_BIT_MASK(n) (~(~0UL << (n)))
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ enum { MAX_VERSION_SIZE = 100 };
+ 
+ typedef struct txCtx_ *txCtx; /* tx program context */
+@@ -587,4 +592,8 @@
+ void ttrReadFont(txCtx h, long origin, int iTTC);
+ void ufoReadFont(txCtx h, long origin);
+ 
++#ifdef __cplusplus
++}
++#endif
++
+ #endif /* TX_SHARED_H */
diff --git a/vcl/source/gdi/afdko.hxx b/vcl/source/gdi/afdko.hxx
index 6eb64f9e6672..07916dac1f19 100644
--- a/vcl/source/gdi/afdko.hxx
+++ b/vcl/source/gdi/afdko.hxx
@@ -15,10 +15,11 @@
 
 #pragma once
 
-extern "C" {
 #include <tx_shared.h>
 #include <hotconv.h>
 #include <cb.h>
+
+extern "C" {
 extern txCtx txNew(char* progname);
 extern void txFree(txCtx h);
 extern void cfrReadFont(txCtx h, long origin, int ttcIndex);

Reply via email to