]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/decNumberLocal.h
ICU-64260.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / decNumberLocal.h
index a45b7d8cc63ef2a5be7e0f5241c7a634b352440c..f6c291a9ad335917a4afc6cc5ccbe8728f74b221 100644 (file)
 
   /* 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, \
     #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
 
 
   /* 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)