diff --git a/icu4c/source/common/icucfg.h.in b/icu4c/source/common/icucfg.h.in index 59ed2744977..e564fa826a4 100644 --- a/icu4c/source/common/icucfg.h.in +++ b/icu4c/source/common/icucfg.h.in @@ -34,7 +34,7 @@ #undef SIZEOF_WCHAR_T /* Define if you have the header file. */ -#undef HAVE_INTTYPES_H +#undef U_HAVE_INTTYPES_H /* Define if you have the cma library (-lcma). */ #undef HAVE_LIBCMA diff --git a/icu4c/source/common/putil.c b/icu4c/source/common/putil.c index 04cc6eca95f..01209a96291 100644 --- a/icu4c/source/common/putil.c +++ b/icu4c/source/common/putil.c @@ -86,7 +86,7 @@ # include #elif defined(AIX) # include -#elif defined(SOLARIS) || defined(LINUX) +#elif defined(U_SOLARIS) || defined(U_LINUX) # include # include #elif defined(HPUX) @@ -848,7 +848,7 @@ getLibraryPath(char *path, int size) { # elif defined(OS390) # elif defined(OS400) # elif defined(XP_MAC) -# elif defined(SOLARIS) +# elif defined(U_SOLARIS) void *handle=dlopen(U_COMMON_LIBNAME, RTLD_LAZY); /* "libicu-uc.so" */ if(handle!=NULL) { Link_map *p=NULL; @@ -880,7 +880,7 @@ getLibraryPath(char *path, int size) { dlclose(handle); return length; } -# elif defined(LINUX) +# elif defined(U_LINUX) # elif defined(AIX) void *handle=(void*)load(U_COMMON_LIBNAME, L_LIBPATH_EXEC, "."); /* "libicu-uc.a" */ if(handle!=NULL) { @@ -977,8 +977,8 @@ findLibraryPath(char *path, int size) { # define LIB_FILENAME "libicuuc.a" # elif defined(OS400) # elif defined(XP_MAC) -# elif defined(SOLARIS) -# elif defined(LINUX) +# elif defined(U_SOLARIS) +# elif defined(U_LINUX) # define LIB_PATH_VAR "LD_LIBRARY_PATH" # define LIB_FILENAME "libicuuc.so" # elif defined(AIX) @@ -1480,7 +1480,7 @@ const char* uprv_getDefaultCodepage() { uprv_memset(codesetName, 0, 100); } -#ifdef LINUX +#ifdef U_LINUX if (nl_langinfo(_NL_CTYPE_CODESET_NAME) != NULL) uprv_strcpy(codesetName, nl_langinfo(_NL_CTYPE_CODESET_NAME)); #else diff --git a/icu4c/source/common/ucnv_io.c b/icu4c/source/common/ucnv_io.c index 67ba1a8d292..3b2e5ecb57f 100644 --- a/icu4c/source/common/ucnv_io.c +++ b/icu4c/source/common/ucnv_io.c @@ -136,28 +136,27 @@ isAlias(const char *alias, UErrorCode *pErrorCode) { } } -/* compare lowercase str1 with mixed-case str2, ignoring case */ +/* compare lowercase str1 with mixed-case str2, both being charset names */ static int -strHalfCaseCmp(const char *str1, const char *str2) { - /* compare non-NULL strings lexically with lowercase */ +charsetNameCmp(const char *str1, const char *str2) { int rc; unsigned char c1, c2; - for(;;) { - c1=(unsigned char)*str1; - c2=(unsigned char)*str2; - if(c1==0) { - if(c2==0) { + for (;;) { + c1 = (unsigned char) *str1; + c2 = (unsigned char) *str2; + if (c1 == 0) { + if(c2 == 0) { return 0; } else { return -1; } - } else if(c2==0) { + } else if (c2 == 0) { return 1; } else { /* compare non-zero characters with lowercase */ - rc=(int)c1-(int)(unsigned char)uprv_tolower(c2); - if(rc!=0) { + rc = (int) c1 - (int) (unsigned char) uprv_tolower(c2); + if(rc != 0) { return rc; } } @@ -192,7 +191,7 @@ findAlias(const char *alias) { start=0; while(start header, you may need to edit the typedefs below. */ -#if HAVE_INTTYPES_H +#if U_HAVE_INTTYPES_H #include #else #include diff --git a/icu4c/source/common/unicode/pos2.h b/icu4c/source/common/unicode/pos2.h index 5a1622044e8..606b495cf54 100644 --- a/icu4c/source/common/unicode/pos2.h +++ b/icu4c/source/common/unicode/pos2.h @@ -22,7 +22,7 @@ #endif /* Define whether inttypes.h is available */ -#define HAVE_INTTYPES_H 0 +#define U_HAVE_INTTYPES_H 0 /* * Define what support for C++ streams is available. @@ -58,7 +58,7 @@ /* If your platform does not have the header, you may need to edit the typedefs below. */ -#if HAVE_INTTYPES_H +#if U_HAVE_INTTYPES_H #include #else diff --git a/icu4c/source/common/unicode/pos400.h b/icu4c/source/common/unicode/pos400.h index ccfe1cbf630..7b22b565e18 100644 --- a/icu4c/source/common/unicode/pos400.h +++ b/icu4c/source/common/unicode/pos400.h @@ -23,7 +23,7 @@ #endif /* Define whether inttypes.h is available */ -#define HAVE_INTTYPES_H 0 +#define U_HAVE_INTTYPES_H 0 /* * Define what support for C++ streams is available. @@ -59,7 +59,7 @@ /* If your platform does not have the header, you may need to edit the typedefs below. */ -#if HAVE_INTTYPES_H +#if U_HAVE_INTTYPES_H #include #else diff --git a/icu4c/source/common/unicode/pwin32.h b/icu4c/source/common/unicode/pwin32.h index 898dbe62e15..50e839d453c 100644 --- a/icu4c/source/common/unicode/pwin32.h +++ b/icu4c/source/common/unicode/pwin32.h @@ -22,7 +22,7 @@ #endif /* Define whether inttypes.h is available */ -#define HAVE_INTTYPES_H 0 +#define U_HAVE_INTTYPES_H 0 /* * Define what support for C++ streams is available. @@ -58,7 +58,7 @@ /* If your platform does not have the header, you may need to edit the typedefs below. */ -#if HAVE_INTTYPES_H +#if U_HAVE_INTTYPES_H #include #else diff --git a/icu4c/source/config/Makefile.inc.in b/icu4c/source/config/Makefile.inc.in index b385e93f3a4..28296ebc4cd 100644 --- a/icu4c/source/config/Makefile.inc.in +++ b/icu4c/source/config/Makefile.inc.in @@ -2,7 +2,7 @@ #****************************************************************************** # Copyright (C) 1999, International Business Machines # Corporation and others. All Rights Reserved. -# $Revision: 1.2 $ +# $Revision: 1.3 $ #****************************************************************************** # This Makefile is designed to be included into projects which make use # of the ICU. @@ -52,7 +52,7 @@ host_vendor=@host_vendor@ host_os=@host_os@ LIB_M=@LIB_M@ CPP=@CPP@ -HAVE_INTTYPES_H=@HAVE_INTTYPES_H@ +U_HAVE_INTTYPES_H=@U_HAVE_INTTYPES_H@ U_IS_BIG_ENDIAN=@U_IS_BIG_ENDIAN@ HAVE_INT8_T=@HAVE_INT8_T@ HAVE_UINT8_T=@HAVE_UINT8_T@ diff --git a/icu4c/source/configure b/icu4c/source/configure index c501240af99..cf616e80163 100755 --- a/icu4c/source/configure +++ b/icu4c/source/configure @@ -2068,9 +2068,9 @@ fi done if test $ac_cv_header_inttypes_h = no; then -HAVE_INTTYPES_H=0 +U_HAVE_INTTYPES_H=0 else -HAVE_INTTYPES_H=1 +U_HAVE_INTTYPES_H=1 fi @@ -2908,16 +2908,16 @@ else fi case "${host}" in - *-*-solaris*) platform=SOLARIS ;; - *-*-linux*) platform=LINUX ;; - *-*-freebsd*) platform=LINUX ;; + *-*-solaris*) platform=U_SOLARIS ;; + *-*-linux*) platform=U_LINUX ;; + *-*-freebsd*) platform=U_LINUX ;; *-*-aix*) platform=AIX ;; *-*-hpux*) platform=HPUX ;; *-*-irix*) platform=IRIX ;; *-*-os390*) platform=OS390 ;; *-*-os400*) platform=OS400 ;; - *-apple-rhapsody*) platform=RHAPSODY ;; - *) platform=UNKNOWN ;; + *-apple-rhapsody*) platform=U_RHAPSODY ;; + *) platform=U_UNKNOWN_PLATFORM ;; esac host_frag=$icu_cv_host_frag @@ -3154,7 +3154,7 @@ s%@THREADS_FALSE@%$THREADS_FALSE%g s%@ICU_USE_THREADS@%$ICU_USE_THREADS%g s%@HAVE_DLOPEN@%$HAVE_DLOPEN%g s%@CPP@%$CPP%g -s%@HAVE_INTTYPES_H@%$HAVE_INTTYPES_H%g +s%@U_HAVE_INTTYPES_H@%$U_HAVE_INTTYPES_H%g s%@CXXCPP@%$CXXCPP%g s%@U_IOSTREAM_SOURCE@%$U_IOSTREAM_SOURCE%g s%@U_IS_BIG_ENDIAN@%$U_IS_BIG_ENDIAN%g diff --git a/icu4c/source/configure.in b/icu4c/source/configure.in index 3d3aa1c2b0b..a1ad5a73434 100644 --- a/icu4c/source/configure.in +++ b/icu4c/source/configure.in @@ -197,11 +197,11 @@ AC_SUBST(HAVE_DLOPEN) dnl Checks for header files AC_CHECK_HEADERS(inttypes.h) if test $ac_cv_header_inttypes_h = no; then -HAVE_INTTYPES_H=0 +U_HAVE_INTTYPES_H=0 else -HAVE_INTTYPES_H=1 +U_HAVE_INTTYPES_H=1 fi -AC_SUBST(HAVE_INTTYPES_H) +AC_SUBST(U_HAVE_INTTYPES_H) if test x$U_IOSTREAM_SOURCE = x then @@ -370,17 +370,17 @@ ICU_CONDITIONAL(SAMPLES, test "$samples" = true) dnl Platform-specific Makefile setup case "${host}" in - *-*-solaris*) platform=SOLARIS ;; - *-*-linux*) platform=LINUX ;; - *-*-freebsd*) platform=LINUX ;; + *-*-solaris*) platform=U_SOLARIS ;; + *-*-linux*) platform=U_LINUX ;; + *-*-freebsd*) platform=U_LINUX ;; *-*-aix*) platform=AIX ;; *-sequent-*) platform=PTX ;; *-*-hpux*) platform=HPUX ;; *-*-irix*) platform=IRIX ;; *-*-os390*) platform=OS390 ;; *-*-os400*) platform=OS400 ;; - *-apple-rhapsody*) platform=RHAPSODY ;; - *) platform=UNKNOWN ;; + *-apple-rhapsody*) platform=U_RHAPSODY ;; + *) platform=U_UNKNOWN_PLATFORM ;; esac AC_SUBST(platform) host_frag=$icu_cv_host_frag diff --git a/icu4c/source/test/cintltst/cintltst.c b/icu4c/source/test/cintltst/cintltst.c index a142b189d63..a096564cbbc 100644 --- a/icu4c/source/test/cintltst/cintltst.c +++ b/icu4c/source/test/cintltst/cintltst.c @@ -134,7 +134,7 @@ ctest_getTestDirectory() { if (_testDirectory == NULL) { -#if defined(_AIX) || defined(SOLARIS) || defined(LINUX) || defined(HPUX) || defined(POSIX) || defined(OS390) +#if defined(_AIX) || defined(U_SOLARIS) || defined(U_LINUX) || defined(HPUX) || defined(POSIX) || defined(OS390) ctest_setTestDirectory("source|test|testdata|"); #else ctest_setTestDirectory("icu|source|test|testdata|"); diff --git a/icu4c/source/test/intltest/intltest.cpp b/icu4c/source/test/intltest/intltest.cpp index 6dc83bcdc37..ce33a122bf0 100644 --- a/icu4c/source/test/intltest/intltest.cpp +++ b/icu4c/source/test/intltest/intltest.cpp @@ -376,7 +376,7 @@ IntlTest::pathnameInContext( char* fullname, int32_t maxsize, const char* relPat mainDirBuffer[0]='\0'; } mainDir=mainDirBuffer; - #elif defined(_AIX) || defined(SOLARIS) || defined(LINUX) || defined(HPUX) || defined(POSIX) || defined(OS390) + #elif defined(_AIX) || defined(U_SOLARIS) || defined(U_LINUX) || defined(HPUX) || defined(POSIX) || defined(OS390) char mainDirBuffer[200]; strcpy(mainDirBuffer, u_getDataDirectory()); strcat(mainDirBuffer, "/../"); @@ -402,7 +402,7 @@ IntlTest::pathnameInContext( char* fullname, int32_t maxsize, const char* relPat } mainDir=mainDirBuffer; sepChar = '\\'; - #elif defined(_AIX) || defined(SOLARIS) || defined(LINUX) || defined(HPUX) || defined(OS390) + #elif defined(_AIX) || defined(SOLARIS) || defined(U_LINUX) || defined(HPUX) || defined(OS390) mainDir = getenv("HOME"); sepChar = '/'; #elif defined(XP_MAC) @@ -443,7 +443,7 @@ IntlTest::getTestDirectory() { if (_testDirectory == NULL) { -#if defined(_AIX) || defined(SOLARIS) || defined(LINUX) || defined(HPUX) || defined(POSIX) || defined(OS390) +#if defined(_AIX) || defined(SOLARIS) || defined(U_LINUX) || defined(HPUX) || defined(POSIX) || defined(OS390) setTestDirectory("source|test|testdata|"); #else setTestDirectory("icu|source|test|testdata|"); diff --git a/icu4c/source/test/intltest/tsmthred.cpp b/icu4c/source/test/intltest/tsmthred.cpp index 1a6ad5a0c6f..04377f42665 100644 --- a/icu4c/source/test/intltest/tsmthred.cpp +++ b/icu4c/source/test/intltest/tsmthred.cpp @@ -16,7 +16,7 @@ #define POSIX 1 #endif -#if defined(POSIX)||defined(SOLARIS)||defined(AIX)||defined(HPUX) +#if defined(POSIX)||defined(U_SOLARIS)||defined(AIX)||defined(HPUX) #define HAVE_IMP #include @@ -180,7 +180,7 @@ SimpleThread::sleep(int32_t millis) #endif -#if defined(POSIX)||defined(SOLARIS)||defined(AIX)||defined(HPUX) +#if defined(POSIX)||defined(U_SOLARIS)||defined(AIX)||defined(HPUX) #define HAVE_IMP struct PosixThreadImplementation @@ -227,7 +227,7 @@ void SimpleThread::start() void SimpleThread::sleep(int32_t millis) { -#ifdef SOLARIS +#ifdef U_SOLARIS sigignore(SIGALRM); #endif diff --git a/icu4c/source/test/intltest/tsmutex.cpp b/icu4c/source/test/intltest/tsmutex.cpp index 9785b3fd575..fd8bafec89b 100644 --- a/icu4c/source/test/intltest/tsmutex.cpp +++ b/icu4c/source/test/intltest/tsmutex.cpp @@ -8,7 +8,7 @@ #include #include -#ifdef SOLARIS +#ifdef U_SOLARIS #include #endif diff --git a/icu4c/source/tools/icupkg.inc.in b/icu4c/source/tools/icupkg.inc.in index e9ad9687667..a8edeaf3e7e 100644 --- a/icu4c/source/tools/icupkg.inc.in +++ b/icu4c/source/tools/icupkg.inc.in @@ -54,7 +54,7 @@ host_vendor=@host_vendor@ host_os=@host_os@ LIB_M=@LIB_M@ CPP=@CPP@ -HAVE_INTTYPES_H=@HAVE_INTTYPES_H@ +U_HAVE_INTTYPES_H=@U_HAVE_INTTYPES_H@ U_IS_BIG_ENDIAN=@U_IS_BIG_ENDIAN@ HAVE_INT8_T=@HAVE_INT8_T@ HAVE_UINT8_T=@HAVE_UINT8_T@ @@ -94,6 +94,6 @@ ifeq ($(strip $(PLATFORM)),HPUX) TOOL=env LD_LIBRARY_PATH=../source/common:../source/i18n:../source/tools/toolutil endif -ifeq ($(strip $(PLATFORM)),LINUX) +ifeq ($(strip $(PLATFORM)),U_LINUX) TOOL=env LD_LIBRARY_PATH=../source/common:../source/i18n:../source/tools/toolutil endif