LIBC=$(TOPDIR)libc.a
PRINTF_FLAGS =
+SCANF_FLAGS =
ifeq ($(HAS_FLOATS),true)
PRINTF_FLAGS += -DWANT_DOUBLE
+ SCANF_FLAGS += -DWANT_DOUBLE
endif
ifeq ($(HAS_LONG_LONG),true)
PRINTF_FLAGS += -DWANT_LONG_LONG
+ SCANF_FLAGS += -DWANT_LONG_LONG
endif
MSRC=stdio.c
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(MOBJ3): $(MSRC3)
- $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
+ $(CC) $(CFLAGS) $(SCANF_FLAGS) -DL_$* $< -c -o $*.o
$(STRIPTOOL) -x -R .note -R .comment $*.o
$(COBJS): %.o : %.c
va_list ap;
{
+#if WANT_LONG_LONG
+ long long n;
+#else
register long n;
+#endif
register int c, width, lval, cnt = 0;
int store, neg, base, wide1, endnull, rngflag, c2;
register unsigned char *p;
case '*':
endnull = store = 0;
goto fmtnxt;
-
case 'l': /* long data */
lval = 1;
+#if WANT_LONG_LONG
+ if (*fmt == 'L') { /* long long data */
+ lval = 2;
+ }
+#endif
goto fmtnxt;
case 'h': /* short data */
lval = 0;
case 'u': /* unsigned decimal */
numfmt:skip();
+#if 0
if (isupper(*fmt))
lval = 1;
+#endif
if (!base) {
base = 10;
if (store) {
if (neg == 1)
n = -n;
- if (lval)
+#if WANT_LONG_LONG
+ if (lval == 2)
+ *va_arg(ap, long long *) = n;
+
+ else
+#endif
+ if (lval == 1)
*va_arg(ap, long *) = n;
else
case 'g':
skip();
fprintf(stderr, "LIBM:SCANF");
-
+#if 0
if (isupper(*fmt))
lval = 1;
+#endif
fstate = FS_INIT;
neg = 0;