X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/2ca993e82fb37b597a3c73ecd1586a139a6579c5..a01113dcd0f39d5da295ef82785beff9ed86fe38:/icuSources/i18n/decNumberLocal.h?ds=sidebyside diff --git a/icuSources/i18n/decNumberLocal.h b/icuSources/i18n/decNumberLocal.h index c6e542d0..f6c291a9 100644 --- a/icuSources/i18n/decNumberLocal.h +++ b/icuSources/i18n/decNumberLocal.h @@ -1,3 +1,5 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ------------------------------------------------------------------ */ /* decNumber package local type, tuning, and macro definitions */ /* ------------------------------------------------------------------ */ @@ -164,7 +166,9 @@ /* Set DECDPUNMAX -- the maximum integer that fits in DECDPUN */ /* digits, and D2UTABLE -- the initializer for the D2U table */ - #if DECDPUN==1 + #ifndef DECDPUN + // no-op + #elif DECDPUN==1 #define DECDPUNMAX 9 #define D2UTABLE {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17, \ 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32, \ @@ -210,7 +214,7 @@ #define D2UTABLE {0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3, \ 3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5, \ 5,5,6,6,6,6} - #elif defined(DECDPUN) + #else #error DECDPUN must be in the range 1-9 #endif @@ -226,9 +230,9 @@ /* D2U -- return the number of Units needed to hold d digits */ /* (runtime version, with table lookaside for small d) */ - #if DECDPUN==8 + #if defined(DECDPUN) && DECDPUN==8 #define D2U(d) ((unsigned)((d)<=DECMAXD2U?d2utable[d]:((d)+7)>>3)) - #elif DECDPUN==4 + #elif defined(DECDPUN) && DECDPUN==4 #define D2U(d) ((unsigned)((d)<=DECMAXD2U?d2utable[d]:((d)+3)>>2)) #else #define D2U(d) ((d)<=DECMAXD2U?d2utable[d]:((d)+DECDPUN-1)/DECDPUN)