From: George R. <gr...@us...> - 2002-08-30 04:34:52
|
I can't reproduce your problem. I added this test to our C++ test code, and it compiled and ran just fine on Visual C++ 6. if(UTF8_COUNT_TRAIL_BYTES(0x7F) != 0 || UTF8_COUNT_TRAIL_BYTES(0xC0) != 1 || UTF8_COUNT_TRAIL_BYTES(0xE0) != 2 || UTF8_COUNT_TRAIL_BYTES(0xF0) != 3) { errln("Test_UTF8_COUNT_TRAIL_BYTES: UTF8_COUNT_TRAIL_BYTES does not work right! " "See utf8.h."); } Are your project settings correct? Maybe if you showed us the exact compiler error, we can see what is the problem for your code. George Rhoten IBM Globalization Center of Competency/ICU San Jose, CA, USA "Robert Buck" <rb...@ma...> 08/29/2002 12:24 PM To: George Rhoten/San Jose/IBM@IBMUS, "'Helena Shih'" <hs...@jt...> cc: "'icu4c-support list'" <icu...@ww...> Subject: RE: utf8.h , C++ , problems, and the answer... Dang! That won't work (what I previously suggested) either because of the existing header file layout in ICU. That is only part of the solution. After over a day of work I have narrowed the patch down to what is in the attached zip file. Please review. Apart from these changes it does not look as if it will be possible to use the macro of question in utf8.h from a C++ program. The changes include: (a) the changes previously cited, using U_COMMON_API in appropriate places. (b) clustering the exports definitions together. Presently they are scattered across several header files. The critical ones, presently in utypes.h (no clue why they are in that place) are now moved down into umachine.h immediately _after_ the includes of utf<xx>.h header files. This fix is required to get C++ working with this macro too. Would it be possible for someone review these patch changes and check them in? -Bob |