[tlbuild] Building on the Macintosh

Apostolos Syropoulos asyropoulos at gmail.com
Wed Jan 17 17:05:44 CET 2018


2018-01-17 17:32 GMT+02:00 Richard Koch <koch at uoregon.edu>:

>
>
> Notice that in modern C++, char16_t is a BUILT-IN type. So it seems to me
> that efforts to tell compilers to equate it to something else are likely
> not to work. (Maybe a naive opinion!)
>
>
​This is absolutely true. However, in mu case, ​compilation stops as
follows:

gcc64 -std=gnu99 -D_REENTRANT  -DU_HAVE_ELF_H=1 -DU_ENABLE_DYLOAD=0
-DU_HAVE_ATOMIC=1 -DU_HAVE_TIMEZONE=0 -DU_HAVE_STRTOD_L=0
-I/container/source/texlive/source/Work/libs/icu/../../../libs/icu/icu-src/source/common
"-DDEFAULT_ICU_PLUGINS=\"/usr/local/lib/icu\" " -DU_ATTRIBUTE_DEPRECATED=
-DU_COMMON_IMPLEMENTATION  -O2 -Wall -pedantic -Wshadow -Wpointer-arith
-Wmissing-prototypes -Wwrite-strings    -c   -o umapfile.ao
/container/source/texlive/source/Work/libs/icu/../../../libs/icu/icu-src/source/common/umapfile.c
In file included from
/container/source/texlive/source/Work/libs/icu/../../../libs/icu/icu-src/source/common/unicode/utypes.h:38:0,
                 from
/container/source/texlive/source/Work/libs/icu/../../../libs/icu/icu-src/source/common/unicode/putil.h:29,
                 from
/container/source/texlive/source/Work/libs/icu/../../../libs/icu/icu-src/source/common/umapfile.c:24:
/container/source/texlive/source/Work/libs/icu/../../../libs/icu/icu-src/source/common/unicode/umachine.h:343:13:
error: unknown type name ‘char16_t’
     typedef char16_t UChar;

​It is the C compiler that cannot find the symbol not the C++ compiler. ​
In particular, the problem appears in the following code in
source/libs/icu/icu-src/source/common/unicode/umachine.h

#if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
|| \
        defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
    // Inside the ICU library code, never configurable.
    typedef char16_t UChar;
//<------------------------------------------HERE
#elif defined(UCHAR_TYPE)
    typedef UCHAR_TYPE UChar;
#elif defined(__cplusplus)
    typedef char16_t UChar;
#else
    typedef uint16_t UChar;
#endif

​​In my case the following patch allows compilation of icu

​--- umachine.h.old      2018-01-17 17:47:03.110703298 +0000
+++ umachine.h  2018-01-17 17:58:59.936513757 +0000
@@ -340,7 +340,12 @@
 #if defined(U_COMBINED_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
|| \
         defined(U_I18N_IMPLEMENTATION) || defined(U_IO_IMPLEMENTATION)
     // Inside the ICU library code, never configurable.
+#ifdef __cplusplus
     typedef char16_t UChar;
+#else
+    typedef uint16_t char16_t;
+    typedef uint16_t UChar;
+#endif
 #elif defined(UCHAR_TYPE)
     typedef UCHAR_TYPE UChar;
 #elif defined(__cplusplus)
​
​A.S.​

-- 
Apostolos Syropoulos
Xanthi, GREECE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tlbuild/attachments/20180117/b336b161/attachment.html>


More information about the tlbuild mailing list