Ensure that numeric.c compiles with other NBASE values.

As noted in the comments, support for different NBASE values is really
only of historical interest, but as long as we're keeping it, we might
as well make sure that it compiles.

Joel Jacobson

Discussion: https://postgr.es/m/06712c29-98e9-43b3-98da-f234d81c6e49%40app.fastmail.com
This commit is contained in:
Dean Rasheed 2023-02-02 09:39:08 +00:00
parent 117d2604c2
commit 9a84f2947b
1 changed files with 8 additions and 0 deletions

View File

@ -4245,7 +4245,15 @@ int64_div_fast_to_numeric(int64 val1, int log10val2)
*/
if (m > 0)
{
#if DEC_DIGITS == 4
static int pow10[] = {1, 10, 100, 1000};
#elif DEC_DIGITS == 2
static int pow10[] = {1, 10};
#elif DEC_DIGITS == 1
static int pow10[] = {1};
#else
#error unsupported NBASE
#endif
StaticAssertDecl(lengthof(pow10) == DEC_DIGITS, "mismatch with DEC_DIGITS");