patch 8.2.0271: the "num64" feature is available everywhere
Problem: The "num64" feature is available everywhere and building without
it causes problems.
Solution: Graduage the "num64" feature. (James McCoy, closes #5650)
diff --git a/src/message.c b/src/message.c
index 935fd8c..9ab0eae 100644
--- a/src/message.c
+++ b/src/message.c
@@ -4246,10 +4246,8 @@
# define TMP_LEN 350 // On my system 1e308 is the biggest number possible.
// That sounds reasonable to use as the maximum
// printable.
-# elif defined(FEAT_NUM64)
-# define TMP_LEN 66
# else
-# define TMP_LEN 34
+# define TMP_LEN 66
# endif
char tmp[TMP_LEN];
@@ -4374,11 +4372,7 @@
if (length_modifier == 'l' && *p == 'l')
{
// double l = long long
-# ifdef FEAT_NUM64
length_modifier = 'L';
-# else
- length_modifier = 'l'; // treat it as a single 'l'
-# endif
p++;
}
}
@@ -4394,7 +4388,7 @@
default: break;
}
-# if defined(FEAT_EVAL) && defined(FEAT_NUM64)
+# if defined(FEAT_EVAL)
switch (fmt_spec)
{
case 'd': case 'u': case 'o': case 'x': case 'X':
@@ -4516,11 +4510,9 @@
long int long_arg = 0;
unsigned long int ulong_arg = 0;
-# ifdef FEAT_NUM64
// only defined for length modifier ll
varnumber_T llong_arg = 0;
uvarnumber_T ullong_arg = 0;
-# endif
// only defined for b conversion
uvarnumber_T bin_arg = 0;
@@ -4581,19 +4573,17 @@
else if (long_arg < 0)
arg_sign = -1;
break;
-# ifdef FEAT_NUM64
case 'L':
llong_arg =
-# if defined(FEAT_EVAL)
+# if defined(FEAT_EVAL)
tvs != NULL ? tv_nr(tvs, &arg_idx) :
-# endif
+# endif
va_arg(ap, varnumber_T);
if (llong_arg > 0)
arg_sign = 1;
else if (llong_arg < 0)
arg_sign = -1;
break;
-# endif
}
}
else
@@ -4622,18 +4612,16 @@
if (ulong_arg != 0)
arg_sign = 1;
break;
-# ifdef FEAT_NUM64
case 'L':
ullong_arg =
-# if defined(FEAT_EVAL)
+# if defined(FEAT_EVAL)
tvs != NULL ? (uvarnumber_T)
tv_nr(tvs, &arg_idx) :
-# endif
+# endif
va_arg(ap, uvarnumber_T);
if (ullong_arg != 0)
arg_sign = 1;
break;
-# endif
}
}
@@ -4687,17 +4675,13 @@
;
else if (length_modifier == 'L')
{
-# ifdef FEAT_NUM64
-# ifdef MSWIN
+# ifdef MSWIN
f[f_l++] = 'I';
f[f_l++] = '6';
f[f_l++] = '4';
-# else
- f[f_l++] = 'l';
- f[f_l++] = 'l';
-# endif
# else
f[f_l++] = 'l';
+ f[f_l++] = 'l';
# endif
}
else
@@ -4735,11 +4719,9 @@
case 'l': str_arg_l += sprintf(
tmp + str_arg_l, f, long_arg);
break;
-# ifdef FEAT_NUM64
case 'L': str_arg_l += sprintf(
tmp + str_arg_l, f, llong_arg);
break;
-# endif
}
}
else
@@ -4754,11 +4736,9 @@
case 'l': str_arg_l += sprintf(
tmp + str_arg_l, f, ulong_arg);
break;
-# ifdef FEAT_NUM64
case 'L': str_arg_l += sprintf(
tmp + str_arg_l, f, ullong_arg);
break;
-# endif
}
}