#define ARG() \
_ulong = flags&LONGINT ? va_arg(argp, long) : \
- flags&SHORTINT ? va_arg(argp, short) : va_arg(argp, int);
+ /*flags&SHORTINT ? va_arg(argp, short) :*/ va_arg(argp, int);
#define todigit(c) ((c) - '0')
#define tochar(n) ((n) + '0')
#define ARG() \
_ulong = flags&LONGINT ? va_arg(argp, long) : \
- flags&SHORTINT ? va_arg(argp, short) : va_arg(argp, int);
+ /*flags&SHORTINT ? va_arg(argp, short) :*/ va_arg(argp, int);
#define todigit(c) ((c) - '0')
#define tochar(n) ((n) + '0')
continue
fi
+# j=
+# if test -z "$xflag"
+# then
+## a bit horrible because we cannot redirect sed output to $tmp.c conditionally
+# if test -n "$debug"
+# then
+# echo $xify $tmp_i "|"sed -e "'s/va_arg(x_argp, x_\\\\(unsigned_\\\\)\\\\?\\\\(short\\\\|int\\\\|long\\\\))/_va_arg_\\\\1\\\\2(x_argp)/g'" ">"$tmp.c
+# fi
+# if ! $xify $tmp_i |sed -e 's/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g' >$tmp.c
+# then
+# cflag=1
+# eflag=1
+# continue
+# fi
+# else
+# if test -n "$debug"
+# then
+# echo $xify $tmp_i "|"sed -e "'s/va_arg(x_argp, x_\\(unsigned_\\)\\?\\(short\\|int\\|long\\))/_va_arg_\\1\\2(x_argp)/g'"
+# fi
+# if ! $xify $tmp_i |sed -e 's/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g'
+# then
+# cflag=1
+# eflag=1
+# continue
+# fi
+# cflag=1
+# continue
+# fi
j=
if test -z "$xflag"
then
-# a bit horrible because we cannot redirect sed output to $tmp.c conditionally
- if test -n "$debug"
- then
- echo $xify $tmp_i "|"sed -e "'s/va_arg(x_argp, x_\\\\(unsigned_\\\\)\\\\?\\\\(short\\\\|int\\\\|long\\\\))/_va_arg_\\\\1\\\\2(x_argp)/g'" ">"$tmp.c
- fi
- if ! $xify $tmp_i |sed -e 's/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g' >$tmp.c
- then
- cflag=1
- eflag=1
- continue
- fi
- else
- if test -n "$debug"
- then
- echo $xify $tmp_i "|"sed -e "'s/va_arg(x_argp, x_\\(unsigned_\\)\\?\\(short\\|int\\|long\\))/_va_arg_\\1\\2(x_argp)/g'"
- fi
- if ! $xify $tmp_i |sed -e 's/va_arg(x_argp, x_\(unsigned_\)\?\(short\|int\|long\))/_va_arg_\1\2(x_argp)/g'
- then
- cflag=1
- eflag=1
- continue
- fi
+ j=" $tmp.c"
+ fi
+ if test -n "$debug"
+ then
+ echo $xify $tmp_i$j
+ fi
+ if ! $xify $tmp_i$j
+ then
+ cflag=1
+ eflag=1
+ continue
+ fi
+ if test -n "$xflag"
+ then
cflag=1
continue
fi
else if ((fout = fopen(argv[2], "w")) == 0)
abort();
- fputs("#include <stdint.h>\n\
+ fputs("\
+#include <stdint.h>\n\
typedef int16_t x_short;\n\
typedef int32_t x_int;\n\
typedef int32_t x_long;\n\
typedef uint16_t x_unsigned_short;\n\
typedef uint32_t x_unsigned_int;\n\
-typedef uint32_t x_unsigned_long;\n\
-#define _va_arg_short(argp) va_arg(argp, int)\n\
-#define _va_arg_int(argp) va_arg(argp, int)\n\
-#define _va_arg_long(argp) va_arg(argp, int)\n\
-#define _va_arg_unsigned_short(argp) va_arg(argp, unsigned int)\n\
-#define _va_arg_unsigned_int(argp) va_arg(argp, unsigned int)\n\
-#define _va_arg_unsigned_long(argp) va_arg(argp, unsigned int)\n", fout);
+typedef uint32_t x_unsigned_long;\n", fout);
while (fgets(buf, sizeof(buf), fin)) {
p = buf;
if (p[l] == ';') {
++l;
if (typedef_state == 3) {
+#if 0
fwrite("typedef: ", 9, 1, stderr);
fwrite(typedef_str_data, typedef_str_len, 1, stderr);
putc('\n', stderr);
+#endif
if ((q = malloc(typedef_str_len)) == 0)
abort();
memcpy(q, typedef_str_data, typedef_str_len);