ICU-1732 Add int64_t and uint64_t

X-SVN-Rev: 7796
This commit is contained in:
George Rhoten 2002-02-27 21:52:11 +00:00
parent 74c9d78335
commit 475e05801c
4 changed files with 39 additions and 3 deletions
icu4c/source

View file

@ -174,6 +174,16 @@ typedef unsigned short uint16_t;
# endif
#endif
#if ! U_HAVE_INT64_T
typedef signed long long int64_t;
/* else we may not have a 64-bit type */
#endif
#if ! U_HAVE_UINT64_T
typedef unsigned long long uint64_t;
/* else we may not have a 64-bit type */
#endif
#endif
/*===========================================================================*/

View file

@ -100,6 +100,16 @@ typedef unsigned short uint16_t;
# endif
#endif
#if ! U_HAVE_INT64_T
/* Could use _MSC_VER to detect Microsoft compiler. */
typedef __int64 int64_t;
#endif
#if ! U_HAVE_UINT64_T
/* Could use _MSC_VER to detect Microsoft compiler. */
typedef unsigned __int64 uint64_t;
#endif
#endif
/*===========================================================================*/

View file

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2001, International Business Machines Corporation and
* Copyright (c) 1997-2002, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/* file name: strtest.cpp
@ -35,6 +35,15 @@ void StringTest::TestSizeofWCharT(void) {
}
}
void StringTest::TestSizeofInt64(void) {
if(8!=sizeof(int64_t)) {
errln("TestSizeofInt64: 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");
}
}
void StringTest::TestCharsetFamily(void) {
unsigned char c='A';
if( U_CHARSET_FAMILY==U_ASCII_FAMILY && c!=0x41 ||
@ -64,12 +73,18 @@ void StringTest::runIndexedTest(int32_t index, UBool exec, const char *&name, ch
}
break;
case 2:
name="TestSizeofInt64";
if(exec) {
TestSizeofInt64();
}
break;
case 3:
name="TestCharsetFamily";
if(exec) {
TestCharsetFamily();
}
break;
case 3:
case 4:
name="Test_U_STRING";
if(exec) {
U_STRING_INIT(ustringVar, "aZ0 -", 5);
@ -86,7 +101,7 @@ void StringTest::runIndexedTest(int32_t index, UBool exec, const char *&name, ch
}
}
break;
case 4:
case 5:
name="Test_UNICODE_STRING";
if(exec) {
UnicodeString ustringVar=UNICODE_STRING("aZ0 -", 5);

View file

@ -32,6 +32,7 @@ public:
private:
void TestEndian(void);
void TestSizeofWCharT(void);
void TestSizeofInt64(void);
void TestCharsetFamily(void);
};