diff --git a/icu4c/source/common/Makefile.in b/icu4c/source/common/Makefile.in index a11d6035f21..2061f8b274d 100644 --- a/icu4c/source/common/Makefile.in +++ b/icu4c/source/common/Makefile.in @@ -66,7 +66,7 @@ DEPS = $(OBJECTS:.o=.d) HEADERS = utypes.h uloc.h ures.h ustring.h uchar.h chariter.h \ uchriter.h locid.h resbund.h unicode.h putil.h platform.h unistr.h \ schriter.h normlzr.h ucnv_err.h ucnv.h ucnv_bld.h convert.h \ -ubidi.h bidi.h cmemory.h +ubidi.h bidi.h ## List of phony targets .PHONY : all all-local install install-local clean clean-local \ diff --git a/icu4c/source/common/common.dsp b/icu4c/source/common/common.dsp index 77cd2a15d8c..dc790b68d02 100644 --- a/icu4c/source/common/common.dsp +++ b/icu4c/source/common/common.dsp @@ -267,7 +267,7 @@ SOURCE=.\bidi.h InputPath=.\bidi.h "..\..\include\bidi.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy bidi.h ..\..\include\ + copy bidi.h ..\..\include\ # End Custom Build @@ -277,7 +277,7 @@ InputPath=.\bidi.h InputPath=.\bidi.h "..\..\include\bidi.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy bidi.h ..\..\include\ + copy bidi.h ..\..\include\ # End Custom Build @@ -294,7 +294,7 @@ SOURCE=.\chariter.h InputPath=.\chariter.h "..\..\include\chariter.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy chariter.h ..\..\include\ + copy chariter.h ..\..\include\ # End Custom Build @@ -304,7 +304,7 @@ InputPath=.\chariter.h InputPath=.\chariter.h "..\..\include\chariter.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy chariter.h ..\..\include\ + copy chariter.h ..\..\include\ # End Custom Build @@ -314,31 +314,6 @@ InputPath=.\chariter.h # Begin Source File SOURCE=.\cmemory.h - -!IF "$(CFG)" == "common - Win32 Release" - -# Begin Custom Build -InputPath=.\cmemory.h -InputName=cmemory - -"..\..\include\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputName).h ..\..\include\ - -# End Custom Build - -!ELSEIF "$(CFG)" == "common - Win32 Debug" - -# Begin Custom Build -InputPath=.\cmemory.h -InputName=cmemory - -"..\..\include\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(InputName).h ..\..\include\ - -# End Custom Build - -!ENDIF - # End Source File # Begin Source File @@ -358,7 +333,7 @@ SOURCE=.\convert.h InputPath=.\convert.h "..\..\include\convert.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy convert.h ..\..\include\ + copy convert.h ..\..\include\ # End Custom Build @@ -368,7 +343,7 @@ InputPath=.\convert.h InputPath=.\convert.h "..\..\include\convert.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy convert.h ..\..\include\ + copy convert.h ..\..\include\ # End Custom Build @@ -405,7 +380,7 @@ SOURCE=.\locid.h InputPath=.\locid.h "..\..\include\locid.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy locid.h ..\..\include\ + copy locid.h ..\..\include\ # End Custom Build @@ -415,7 +390,7 @@ InputPath=.\locid.h InputPath=.\locid.h "..\..\include\locid.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy locid.h ..\..\include\ + copy locid.h ..\..\include\ # End Custom Build @@ -440,7 +415,7 @@ SOURCE=.\normlzr.h InputPath=.\normlzr.h "..\..\include\normlzr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy normlzr.h ..\..\include\ + copy normlzr.h ..\..\include\ # End Custom Build @@ -450,7 +425,7 @@ InputPath=.\normlzr.h InputPath=.\normlzr.h "..\..\include\normlzr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy normlzr.h ..\..\include\ + copy normlzr.h ..\..\include\ # End Custom Build @@ -467,7 +442,7 @@ SOURCE=.\putil.h InputPath=.\putil.h "..\..\include\putil.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy putil.h ..\..\include\ + copy putil.h ..\..\include\ # End Custom Build @@ -477,7 +452,7 @@ InputPath=.\putil.h InputPath=.\putil.h "..\..\include\putil.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy putil.h ..\..\include\ + copy putil.h ..\..\include\ # End Custom Build @@ -494,7 +469,7 @@ SOURCE=.\pwin32.h InputPath=.\pwin32.h "..\..\include\pwin32.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy pwin32.h ..\..\include\ + copy pwin32.h ..\..\include\ # End Custom Build @@ -504,7 +479,7 @@ InputPath=.\pwin32.h InputPath=.\pwin32.h "..\..\include\pwin32.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy pwin32.h ..\..\include\ + copy pwin32.h ..\..\include\ # End Custom Build @@ -533,7 +508,7 @@ SOURCE=.\resbund.h InputPath=.\resbund.h "..\..\include\resbund.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy resbund.h ..\..\include\ + copy resbund.h ..\..\include\ # End Custom Build @@ -543,7 +518,7 @@ InputPath=.\resbund.h InputPath=.\resbund.h "..\..\include\resbund.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy resbund.h ..\..\include\ + copy resbund.h ..\..\include\ # End Custom Build @@ -560,7 +535,7 @@ SOURCE=.\schriter.h InputPath=.\schriter.h "..\..\include\schriter.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy schriter.h ..\..\include\ + copy schriter.h ..\..\include\ # End Custom Build @@ -570,7 +545,7 @@ InputPath=.\schriter.h InputPath=.\schriter.h "..\..\include\schriter.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy schriter.h ..\..\include\ + copy schriter.h ..\..\include\ # End Custom Build @@ -587,7 +562,7 @@ SOURCE=.\scsu.h InputPath=.\scsu.h "..\..\include\scsu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy scsu.h ..\..\include\ + copy scsu.h ..\..\include\ # End Custom Build @@ -597,7 +572,7 @@ InputPath=.\scsu.h InputPath=.\scsu.h "..\..\include\scsu.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy scsu.h ..\..\include\ + copy scsu.h ..\..\include\ # End Custom Build @@ -614,7 +589,7 @@ SOURCE=.\ubidi.h InputPath=.\ubidi.h "..\..\include\ubidi.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ubidi.h ..\..\include\ + copy ubidi.h ..\..\include\ # End Custom Build @@ -624,7 +599,7 @@ InputPath=.\ubidi.h InputPath=.\ubidi.h "..\..\include\ubidi.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ubidi.h ..\..\include\ + copy ubidi.h ..\..\include\ # End Custom Build @@ -645,7 +620,7 @@ SOURCE=.\uchar.h InputPath=.\uchar.h "..\..\include\uchar.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy uchar.h ..\..\include\ + copy uchar.h ..\..\include\ # End Custom Build @@ -655,7 +630,7 @@ InputPath=.\uchar.h InputPath=.\uchar.h "..\..\include\uchar.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy uchar.h ..\..\include\ + copy uchar.h ..\..\include\ # End Custom Build @@ -672,7 +647,7 @@ SOURCE=.\uchriter.h InputPath=.\uchriter.h "..\..\include\uchriter.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy uchriter.h ..\..\include\ + copy uchriter.h ..\..\include\ # End Custom Build @@ -682,7 +657,7 @@ InputPath=.\uchriter.h InputPath=.\uchriter.h "..\..\include\uchriter.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy uchriter.h ..\..\include\ + copy uchriter.h ..\..\include\ # End Custom Build @@ -711,7 +686,7 @@ SOURCE=.\ucnv.h InputPath=.\ucnv.h "..\..\include\ucnv.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ucnv.h ..\..\include\ + copy ucnv.h ..\..\include\ # End Custom Build @@ -721,7 +696,7 @@ InputPath=.\ucnv.h InputPath=.\ucnv.h "..\..\include\ucnv.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ucnv.h ..\..\include\ + copy ucnv.h ..\..\include\ # End Custom Build @@ -738,7 +713,7 @@ SOURCE=.\ucnv_bld.h InputPath=.\ucnv_bld.h "..\..\include\ucnv_bld.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ucnv_bld.h ..\..\include\ + copy ucnv_bld.h ..\..\include\ # End Custom Build @@ -748,7 +723,7 @@ InputPath=.\ucnv_bld.h InputPath=.\ucnv_bld.h "..\..\include\ucnv_bld.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ucnv_bld.h ..\..\include\ + copy ucnv_bld.h ..\..\include\ # End Custom Build @@ -769,7 +744,7 @@ SOURCE=.\ucnv_err.h InputPath=.\ucnv_err.h "..\..\include\ucnv_err.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ucnv_err.h ..\..\include\ + copy ucnv_err.h ..\..\include\ # End Custom Build @@ -779,7 +754,7 @@ InputPath=.\ucnv_err.h InputPath=.\ucnv_err.h "..\..\include\ucnv_err.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ucnv_err.h ..\..\include\ + copy ucnv_err.h ..\..\include\ # End Custom Build @@ -804,7 +779,7 @@ SOURCE=.\uloc.h InputPath=.\uloc.h "..\..\include\uloc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy uloc.h ..\..\include\ + copy uloc.h ..\..\include\ # End Custom Build @@ -814,7 +789,7 @@ InputPath=.\uloc.h InputPath=.\uloc.h "..\..\include\uloc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy uloc.h ..\..\include\ + copy uloc.h ..\..\include\ # End Custom Build @@ -835,7 +810,7 @@ SOURCE=.\unicode.h InputPath=.\unicode.h "..\..\include\unicode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy unicode.h ..\..\include\ + copy unicode.h ..\..\include\ # End Custom Build @@ -845,7 +820,7 @@ InputPath=.\unicode.h InputPath=.\unicode.h "..\..\include\unicode.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy unicode.h ..\..\include\ + copy unicode.h ..\..\include\ # End Custom Build @@ -862,7 +837,7 @@ SOURCE=.\unistr.h InputPath=.\unistr.h "..\..\include\unistr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy unistr.h ..\..\include\ + copy unistr.h ..\..\include\ # End Custom Build @@ -872,7 +847,7 @@ InputPath=.\unistr.h InputPath=.\unistr.h "..\..\include\unistr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy unistr.h ..\..\include\ + copy unistr.h ..\..\include\ # End Custom Build @@ -893,7 +868,7 @@ SOURCE=.\ures.h InputPath=.\ures.h "..\..\include\ures.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ures.h ..\..\include\ + copy ures.h ..\..\include\ # End Custom Build @@ -903,7 +878,7 @@ InputPath=.\ures.h InputPath=.\ures.h "..\..\include\ures.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ures.h ..\..\include\ + copy ures.h ..\..\include\ # End Custom Build @@ -920,7 +895,7 @@ SOURCE=.\ustring.h InputPath=.\ustring.h "..\..\include\ustring.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ustring.h ..\..\include\ + copy ustring.h ..\..\include\ # End Custom Build @@ -930,7 +905,7 @@ InputPath=.\ustring.h InputPath=.\ustring.h "..\..\include\ustring.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy ustring.h ..\..\include\ + copy ustring.h ..\..\include\ # End Custom Build @@ -947,7 +922,7 @@ SOURCE=.\utypes.h InputPath=.\utypes.h "..\..\include\utypes.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy utypes.h ..\..\include\ + copy utypes.h ..\..\include\ # End Custom Build @@ -957,7 +932,7 @@ InputPath=.\utypes.h InputPath=.\utypes.h "..\..\include\utypes.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy utypes.h ..\..\include\ + copy utypes.h ..\..\include\ # End Custom Build diff --git a/icu4c/source/common/cpputils.h b/icu4c/source/common/cpputils.h index 6bbf53bbc2a..f7a81769cba 100644 --- a/icu4c/source/common/cpputils.h +++ b/icu4c/source/common/cpputils.h @@ -5,9 +5,45 @@ #ifdef XP_CPLUSPLUS +#include "cmemory.h" #include "unistr.h" +/*===========================================================================*/ +/* Array copy utility functions */ +/*===========================================================================*/ +inline void icu_arrayCopy(const double* src, double* dst, int32_t count) +{ icu_memcpy(dst, src, (size_t)(count * sizeof(*src))); } + +inline void icu_arrayCopy(const double* src, int32_t srcStart, + double* dst, int32_t dstStart, int32_t count) +{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } + +inline void icu_arrayCopy(const int8_t* src, int8_t* dst, int32_t count) + { icu_memcpy(dst, src, (size_t)(count * sizeof(*src))); } + +inline void icu_arrayCopy(const int8_t* src, int32_t srcStart, + int8_t* dst, int32_t dstStart, int32_t count) +{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } + +inline void icu_arrayCopy(const int16_t* src, int16_t* dst, int32_t count) +{ icu_memcpy(dst, src, (size_t)(count * sizeof(*src))); } + +inline void icu_arrayCopy(const int16_t* src, int32_t srcStart, + int16_t* dst, int32_t dstStart, int32_t count) +{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } + +inline void icu_arrayCopy(const int32_t* src, int32_t* dst, int32_t count) +{ icu_memcpy(dst, src, (size_t)(count * sizeof(*src))); } + +inline void icu_arrayCopy(const int32_t* src, int32_t srcStart, + int32_t* dst, int32_t dstStart, int32_t count) +{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } + +inline void +icu_arrayCopy(const UChar *src, int32_t srcStart, + UChar *dst, int32_t dstStart, int32_t count) +{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } /****************************************************** * Simple utility to set output buffer parameters diff --git a/icu4c/source/common/uchar.c b/icu4c/source/common/uchar.c index 81ed24204e8..392e16a7c45 100644 --- a/icu4c/source/common/uchar.c +++ b/icu4c/source/common/uchar.c @@ -27,6 +27,7 @@ #include "ucmp8.h" #include "umutex.h" #include "uchar.h" +#include "cmemory.h" #include #include @@ -5227,7 +5228,6 @@ createDirTables() umtx_unlock(NULL); } - const char* u_getVersion() { int32_t len=strlen(UNICODE_VERSION) + strlen("Unicode Version "); diff --git a/icu4c/source/common/umutex.c b/icu4c/source/common/umutex.c index 5b1f86de1d3..0df23320d0e 100644 --- a/icu4c/source/common/umutex.c +++ b/icu4c/source/common/umutex.c @@ -59,6 +59,7 @@ #endif #include "umutex.h" +#include "cmemory.h" /* the global mutex. Use it proudly and wash it often. */ UMTX gGlobalMutex = NULL; diff --git a/icu4c/source/common/utypes.h b/icu4c/source/common/utypes.h index eee50053ac7..1b24a6a844e 100644 --- a/icu4c/source/common/utypes.h +++ b/icu4c/source/common/utypes.h @@ -40,7 +40,6 @@ #include #include #include -#include "cmemory.h" /*===========================================================================*/ /* Include platform-dependent definitions */ @@ -285,46 +284,6 @@ inline bool_t FAILURE(UErrorCode code) { return (bool_t)(code>U_ZERO_ERROR); } #define icu_wcstombs(mbstr, wcstr, count) wcstombs(mbstr, wcstr, count) #define icu_mbstowcs(wcstr, mbstr, count) mbstowcs(wcstr, mbstr, count) -/*===========================================================================*/ -/* Array copy utility functions */ -/*===========================================================================*/ - -#ifdef XP_CPLUSPLUS -inline void icu_arrayCopy(const double* src, double* dst, int32_t count) -{ icu_memcpy(dst, src, (size_t)(count * sizeof(*src))); } - -inline void icu_arrayCopy(const double* src, int32_t srcStart, - double* dst, int32_t dstStart, int32_t count) -{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } - -inline void icu_arrayCopy(const int8_t* src, int8_t* dst, int32_t count) - { icu_memcpy(dst, src, (size_t)(count * sizeof(*src))); } - -inline void icu_arrayCopy(const int8_t* src, int32_t srcStart, - int8_t* dst, int32_t dstStart, int32_t count) -{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } - -inline void icu_arrayCopy(const int16_t* src, int16_t* dst, int32_t count) -{ icu_memcpy(dst, src, (size_t)(count * sizeof(*src))); } - -inline void icu_arrayCopy(const int16_t* src, int32_t srcStart, - int16_t* dst, int32_t dstStart, int32_t count) -{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } - -inline void icu_arrayCopy(const int32_t* src, int32_t* dst, int32_t count) -{ icu_memcpy(dst, src, (size_t)(count * sizeof(*src))); } - -inline void icu_arrayCopy(const int32_t* src, int32_t srcStart, - int32_t* dst, int32_t dstStart, int32_t count) -{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } - -inline void -icu_arrayCopy(const UChar *src, int32_t srcStart, - UChar *dst, int32_t dstStart, int32_t count) -{ icu_memcpy(dst+dstStart, src+srcStart, (size_t)(count * sizeof(*src))); } - -#endif - /*===========================================================================*/ /* Debugging */ /*===========================================================================*/