github.com/johnnyeven/libtools@v0.0.0-20191126065708-61829c1adf46/third_party/icu/udata.patch (about)

     1  --- a/icu4c/source/common/unicode/uconfig.h
     2  +++ b/icu4c/source/common/unicode/uconfig.h
     3  @@ -55,6 +55,11 @@
     4   #include "uconfig_local.h"
     5   #endif
     6   
     7  +// Tensorflow is statically linked on all platforms.
     8  +#ifndef U_STATIC_IMPLEMENTATION
     9  +#define U_STATIC_IMPLEMENTATION
    10  +#endif
    11  +
    12   /**
    13    * \def U_DEBUG
    14    * Determines whether to include debugging code.
    15  
    16  --- a/icu4c/source/common/udata.cpp
    17  +++ b/icu4c/source/common/udata.cpp
    18  @@ -18,15 +18,15 @@
    19   
    20   #include "unicode/utypes.h"  /* U_PLATFORM etc. */
    21   
    22  -#ifdef __GNUC__
    23  -/* if gcc
    24  -#define ATTRIBUTE_WEAK __attribute__ ((weak))
    25  -might have to #include some other header
    26  -*/
    27  +#if defined(__GNUC__) || defined(__SUNPRO_CC)
    28  +#  define ATTRIBUTE_WEAK __attribute__ ((weak))
    29  +#else
    30  +#  define ATTRIBUTE_WEAK
    31   #endif
    32   
    33   #include "unicode/putil.h"
    34   #include "unicode/udata.h"
    35  +#include "unicode/umachine.h"
    36   #include "unicode/uversion.h"
    37   #include "charstr.h"
    38   #include "cmemory.h"
    39  @@ -641,10 +641,11 @@
    40    * partial-data-library access functions where each returns a pointer
    41    * to its data package, if it is linked in.
    42    */
    43  -/*
    44  -extern const void *uprv_getICUData_collation(void) ATTRIBUTE_WEAK;
    45  -extern const void *uprv_getICUData_conversion(void) ATTRIBUTE_WEAK;
    46  -*/
    47  +
    48  +//extern "C" const void *uprv_getICUData_collation(void);
    49  +U_CDECL_BEGIN
    50  +const void *uprv_getICUData_conversion(void) ATTRIBUTE_WEAK;
    51  +U_CDECL_END
    52   
    53   /*----------------------------------------------------------------------*
    54    *                                                                      *
    55  @@ -702,10 +703,11 @@
    56           if (uprv_getICUData_collation) {
    57               setCommonICUDataPointer(uprv_getICUData_collation(), FALSE, pErrorCode);
    58           }
    59  +        */
    60           if (uprv_getICUData_conversion) {
    61  -            setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pErrorCode);
    62  +          setCommonICUDataPointer(uprv_getICUData_conversion(), FALSE, pErrorCode);
    63           }
    64  -        */
    65  +
    66   #if U_PLATFORM_HAS_WINUWP_API == 0 // Windows UWP Platform does not support dll icu data at this time
    67           setCommonICUDataPointer(&U_ICUDATA_ENTRY_POINT, FALSE, pErrorCode);
    68           {