comparison loadagent/libprintf/doprnt.c @ 4:5c7b3d5d5702

libprintf compiles with Anshit C GCC
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 29 Apr 2013 07:19:34 +0000
parents 45bf8af5f061
children
comparison
equal deleted inserted replaced
3:45bf8af5f061 4:5c7b3d5d5702
1 /* the guts of printf - this implementation came from 4.3BSD-Tahoe */ 1 /* the guts of printf - this implementation came from 4.3BSD-Tahoe */
2 2
3 #include <sys/types.h> 3 #include <sys/types.h>
4 #include <ctype.h> 4 #include <ctype.h>
5 #include <varargs.h> 5 #include <stdarg.h>
6 6
7 #define PUTC(ch) ((*outfunc)((ch), outfunc_param)) 7 #define PUTC(ch) ((*outfunc)((ch), outfunc_param))
8 8
9 #define ARG() \ 9 #define ARG() \
10 _ulong = flags&LONGINT ? va_arg(argp, long) : \ 10 _ulong = flags&LONGINT ? va_arg(argp, long) : va_arg(argp, int);
11 flags&SHORTINT ? va_arg(argp, short) : va_arg(argp, int);
12 11
13 #define BUF 256 12 #define BUF 256
14 13
15 #define todigit(c) ((c) - '0') 14 #define todigit(c) ((c) - '0')
16 #define tochar(n) ((n) + '0') 15 #define tochar(n) ((n) + '0')