Use the detected no-builtin flag. (NicJA)
[AROS.git] / compiler / stdc / __vcformat.c
blobb663d81ef35fa565c963966240b0117d904bf566
1 /*
2 Copyright © 1995-2018, The AROS Development Team. All rights reserved.
3 $Id$
5 Function to format a string like printf().
6 */
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <stdarg.h>
11 #include <string.h>
12 #ifndef AROS_NO_LIMITS_H
13 # include <limits.h>
14 #else
15 # define ULONG_MAX 4294967295UL
16 #endif
17 #include <math.h>
18 #include <float.h>
20 #include <ctype.h>
22 #ifndef STDC_STATIC
23 #define FULL_SPECIFIERS
24 #endif
26 const unsigned char *const __stdc_char_decimalpoint = ".";
28 /* support macros for FMTPRINTF */
29 #define FMTPRINTF_COUT(c) do \
30 { if((*outc)((unsigned char)(c),data)==EOF) \
31 return outcount; \
32 outcount++; \
33 }while(0)
35 #define FMTPRINTF_STRLEN(str) strlen(str)
37 #define FMTPRINTF_DECIMALPOINT __stdc_char_decimalpoint
39 #include "fmtprintf_pre.c"
41 /*****************************************************************************
43 NAME */
45 int __vcformat (
47 /* SYNOPSIS */
48 void * data,
49 int (* outc)(int, void *),
50 const char * format,
51 va_list args)
53 /* FUNCTION
54 Format a list of arguments and call a function for each char
55 to print.
57 INPUTS
58 data - This is passed to the user callback outc as its second argument.
59 outc - Call this function for every character that should be
60 emitted. The function should return EOF on error and
61 > 0 otherwise.
62 format - A printf() format string.
63 args - A list of arguments for the format string.
65 RESULT
66 The number of characters written.
68 NOTES
70 EXAMPLE
72 BUGS
74 SEE ALSO
76 INTERNALS
78 ******************************************************************************/
80 #include "fmtprintf.c"
81 return outcount;