2 Copyright © 1995-2018, The AROS Development Team. All rights reserved.
5 Desc: Formats a message and makes sure the user will see it.
9 #include <aros/config.h>
10 #include <aros/arossupportbase.h>
13 #include <aros/system.h>
14 #include <proto/exec.h>
15 #include <proto/arossupport.h>
18 #include <exec/execbase.h>
20 #if defined(__AROSEXEC_SMP__)
21 #include <aros/atomic.h>
23 extern volatile ULONG safedebug
;
27 The floating point math code pulls in symbols
28 that cannot be used in the amiga rom
30 #if !defined(__m68k__)
31 #define FULL_SPECIFIERS
34 #if defined(FULL_SPECIFIERS)
38 /* provide inline versions of clib functions
42 static inline int isdigit(int c
)
44 return '0' <= c
&& c
<= '9';
47 static inline unsigned char tolower(unsigned char c
)
49 if ((int)c
>= (int)'A')
54 #define isprint(x) (((x) >= ' ' && (x) <= 128) || (x) >= 160)
65 static inline int kprintf_strlen(const char *c
)
73 #define ULONG_MAX 4294967295UL
75 /* support macros for FMTPRINTF */
76 #define FMTPRINTF_COUT(c) RawPutChar(c)
77 #define FMTPRINTF_STRLEN(str) kprintf_strlen(str)
79 #if defined(FULL_SPECIFIERS)
80 #define FMTPRINTF_DECIMALPOINT __arossupport_char_decimalpoint
83 #include "fmtprintf_pre.c"
85 /*****************************************************************************
88 #include <proto/arossupport.h>
97 Formats fmt with the specified arguments like printf() (and *not*
98 like RawDoFmt()) and uses a secure way to deliver the message to
99 the user; ie. the user *will* see this message no matter what.
102 fmt - printf()-style format string
105 The number of characters output.
108 This function is not part of a library and may thus be called
120 24-12-95 digulla created
122 ******************************************************************************/
128 result
= vkprintf (fmt
, ap
);
134 /******************************************************************************/
135 int vkprintf (const char * format
, va_list args
)
137 #if defined(FULL_SPECIFIERS)
138 const unsigned char *const __arossupport_char_decimalpoint
= ".";
140 #if defined(__AROSEXEC_SMP__)
143 while (bit_test_and_set_long((ULONG
*)&safedebug
, 1)) { asm volatile("pause"); };
146 #include "fmtprintf.c"
147 #if defined(__AROSEXEC_SMP__)
150 __AROS_ATOMIC_AND_L(safedebug
, ~(1 << 1));