ICU-3747 Change int32_t default type from long to int

X-SVN-Rev: 15252
This commit is contained in:
George Rhoten 2004-05-11 16:51:15 +00:00
parent 1bf207e545
commit 89cb0487c3
6 changed files with 41 additions and 49 deletions

View File

@ -142,19 +142,11 @@ typedef unsigned short uint16_t;
#endif
#if ! U_HAVE_INT32_T
# if defined(_LP64)
typedef signed int int32_t;
# else
typedef signed long int32_t;
# endif
typedef signed int int32_t;
#endif
#if ! U_HAVE_UINT32_T
# if defined(_LP64)
typedef unsigned int uint32_t;
# else
typedef unsigned long uint32_t;
# endif
typedef unsigned int uint32_t;
#endif
#if ! U_HAVE_INT64_T

View File

@ -119,29 +119,21 @@ typedef unsigned short uint16_t;
#endif
#if ! U_HAVE_INT32_T
# if defined(_LP64)
typedef signed int int32_t;
# else
typedef signed long int32_t;
# endif
typedef signed int int32_t;
#endif
#if ! U_HAVE_UINT32_T
# if defined(_LP64)
typedef unsigned int uint32_t;
# else
typedef unsigned long uint32_t;
# endif
typedef unsigned int uint32_t;
#endif
#if ! U_HAVE_INT64_T
/* Could use _MSC_VER to detect Microsoft compiler. */
typedef signed __int64 int64_t;
typedef signed __int64 int64_t;
#endif
#if ! U_HAVE_UINT64_T
/* Could use _MSC_VER to detect Microsoft compiler. */
typedef unsigned __int64 uint64_t;
typedef unsigned __int64 uint64_t;
#endif
#endif

View File

@ -16,9 +16,6 @@ SHAREDLIBCPPFLAGS = -DPIC
LIBCPPFLAGS = -D_REENTRANT
THREADSCPPFLAGS = -D_REENTRANT
# Use int for int32_t
DEFS += -D_LP64
# The tests need complete IEEE floating point support
CFLAGS += -ieee
CXXFLAGS += -ieee

View File

@ -16,9 +16,6 @@ SHAREDLIBCPPFLAGS =
LIBCPPFLAGS = -D_REENTRANT
THREADSCPPFLAGS = -D_REENTRANT -pthread
# Use int for int32_t
DEFS += -D_LP64
# The tests need complete IEEE floating point support
CFLAGS += -ieee
CXXFLAGS += -ieee

View File

@ -36,26 +36,47 @@ void StringTest::TestEndian(void) {
}
}
void StringTest::TestSizeofWCharT(void) {
void StringTest::TestSizeofTypes(void) {
if(U_SIZEOF_WCHAR_T!=sizeof(wchar_t)) {
errln("TestSizeofWCharT: U_SIZEOF_WCHAR_T!=sizeof(wchar_t) - U_SIZEOF_WCHAR_T needs to be fixed in platform.h");
}
}
void StringTest::TestSizeofInt64(void) {
#ifdef U_INT64_T_UNAVAILABLE
errln("int64_t and uint64_t are undefined.");
#else
if(8!=sizeof(int64_t)) {
errln("TestSizeofInt64: 8!=sizeof(int64_t) - int64_t needs to be fixed in platform.h");
errln("TestSizeofTypes: 8!=sizeof(int64_t) - int64_t needs to be fixed in platform.h");
}
if(8!=sizeof(uint64_t)) {
errln("TestSizeofInt64: 8!=sizeof(uint64_t) - uint64_t needs to be fixed in platform.h");
errln("TestSizeofTypes: 8!=sizeof(uint64_t) - uint64_t needs to be fixed in platform.h");
}
#endif
if(8!=sizeof(double)) {
errln("8!=sizeof(double) - putil.c code may not work");
}
if(4!=sizeof(int32_t)) {
errln("4!=sizeof(int32_t)");
}
if(4!=sizeof(uint32_t)) {
errln("4!=sizeof(uint32_t)");
}
if(2!=sizeof(int16_t)) {
errln("2!=sizeof(int16_t)");
}
if(2!=sizeof(uint16_t)) {
errln("2!=sizeof(uint16_t)");
}
if(2!=sizeof(UChar)) {
errln("2!=sizeof(UChar)");
}
if(1!=sizeof(int8_t)) {
errln("1!=sizeof(int8_t)");
}
if(1!=sizeof(uint8_t)) {
errln("1!=sizeof(uint8_t)");
}
if(1!=sizeof(UBool)) {
errln("1!=sizeof(UBool)");
}
}
void StringTest::TestCharsetFamily(void) {
@ -81,24 +102,18 @@ void StringTest::runIndexedTest(int32_t index, UBool exec, const char *&name, ch
}
break;
case 1:
name="TestSizeofWCharT";
name="TestSizeofTypes";
if(exec) {
TestSizeofWCharT();
TestSizeofTypes();
}
break;
case 2:
name="TestSizeofInt64";
if(exec) {
TestSizeofInt64();
}
break;
case 3:
name="TestCharsetFamily";
if(exec) {
TestCharsetFamily();
}
break;
case 4:
case 3:
name="Test_U_STRING";
if(exec) {
U_STRING_INIT(ustringVar, "aZ0 -", 5);
@ -115,7 +130,7 @@ void StringTest::runIndexedTest(int32_t index, UBool exec, const char *&name, ch
}
}
break;
case 5:
case 4:
name="Test_UNICODE_STRING";
if(exec) {
UnicodeString ustringVar=UNICODE_STRING("aZ0 -", 5);
@ -131,7 +146,7 @@ void StringTest::runIndexedTest(int32_t index, UBool exec, const char *&name, ch
}
}
break;
case 6:
case 5:
name="Test_UNICODE_STRING_SIMPLE";
if(exec) {
UnicodeString ustringVar=UNICODE_STRING_SIMPLE("aZ0 -");
@ -147,7 +162,7 @@ void StringTest::runIndexedTest(int32_t index, UBool exec, const char *&name, ch
}
}
break;
case 7:
case 6:
name="Test_UTF8_COUNT_TRAIL_BYTES";
if(exec) {
if(UTF8_COUNT_TRAIL_BYTES(0x7F) != 0
@ -160,7 +175,7 @@ void StringTest::runIndexedTest(int32_t index, UBool exec, const char *&name, ch
}
}
break;
case 8:
case 7:
name="TestSTLCompatibility";
if(exec) {
#if defined(WIN32) && defined(_MSC_VER)

View File

@ -31,8 +31,7 @@ public:
private:
void TestEndian(void);
void TestSizeofWCharT(void);
void TestSizeofInt64(void);
void TestSizeofTypes(void);
void TestCharsetFamily(void);
};