ICU-4515 in C++, define U_INLINE=inline

X-SVN-Rev: 17967
This commit is contained in:
Markus Scherer 2005-06-21 21:46:02 +00:00
parent 4f2a64c207
commit 2cb4b09625
5 changed files with 31 additions and 6 deletions

View File

@ -260,7 +260,11 @@ typedef unsigned int uint32_t;
/*===========================================================================*/
#ifndef U_INLINE
#define U_INLINE @U_INLINE@
# ifdef __cplusplus
# define U_INLINE inline
# else
# define U_INLINE @U_INLINE@
# endif
#endif
#define U_ALIGN_CODE(n)

View File

@ -259,7 +259,11 @@ typedef unsigned int uint32_t;
/*===========================================================================*/
#ifndef U_INLINE
#define U_INLINE __inline
# ifdef __cplusplus
# define U_INLINE inline
# else
# define U_INLINE __inline
# endif
#endif
#if defined(_MSC_VER) && defined(_M_IX86)

View File

@ -363,7 +363,11 @@ typedef int32_t UChar32;
#endif
#ifndef U_INLINE
# define U_INLINE
# ifdef XP_CPLUSPLUS
# define U_INLINE inline
# else
# define U_INLINE
# endif
#endif
#include "unicode/urename.h"

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2004, International Business Machines Corporation and
* Copyright (c) 1997-2005, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -21,7 +21,8 @@ PUtilTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /
CASE(2, testPositiveInfinity)
CASE(3, testNegativeInfinity)
CASE(4, testZero)
// CASE(5, testIEEEremainder)
CASE(5, testU_INLINE)
// CASE(, testIEEEremainder)
default: name = ""; break; //needed to end loop
}
@ -548,3 +549,14 @@ PUtilTest::NaNNE(void)
}
}
U_INLINE int32_t inlineTriple(int32_t x) {
return 3*x;
}
// "code" coverage test for Jitterbug 4515 RFE: in C++, use U_INLINE=inline
void
PUtilTest::testU_INLINE() {
if(inlineTriple(2)!=6 || inlineTriple(-55)!=-165) {
errln("inlineTriple() failed");
}
}

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2004, International Business Machines Corporation and
* Copyright (c) 1997-2005, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
@ -30,6 +30,7 @@ private:
void testPositiveInfinity(void);
void testNegativeInfinity(void);
void testZero(void);
void testU_INLINE();
// subtests of testNaN
void testIsNaN(void);