gcc8 update. (NicJA)
[AROS.git] / compiler / alib / sprintf.c
blob4ae1cde5b5a0db34d6c65f66551fba51303993ef
1 /*
2 Copyright © 1995-2018, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/rawfmt.h>
7 #include <proto/exec.h>
8 #include <stdarg.h>
10 #ifdef __mc68000
11 const ULONG m68k_string_sprintf = 0x16c04e75;
12 #endif
14 /*****************************************************************************
16 NAME */
17 #include <proto/alib.h>
19 VOID __sprintf(
21 /* SYNOPSIS */
22 UBYTE *buffer, const UBYTE *format, ...)
24 /* FUNCTION
25 Print a formatted string to a buffer.
27 INPUTS
28 buffer -- the buffer to fill
29 format -- the format string, see the VNewRawDoFmt() documentation
30 for information on which formatting commands there are
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 exec.library/VNewRawDoFmt()
43 INTERNALS
45 *****************************************************************************/
47 #ifdef __mc68000
48 /* Special case for m68k, so that we are AmigaOS 1.x/2.x compliant
49 * New programs should be using snprintf() from stdc.library
51 RawDoFmt(format, (RAWARG)(&format + 1), (VOID_FUNC)&m68k_string_sprintf,
52 buffer);
53 #else
54 va_list args;
56 va_start(args, format);
57 VNewRawDoFmt(format, RAWFMTFUNC_STRING, buffer, args);
58 va_end(args);
59 #endif
60 } /* sprintf */