diff options
author | Marco Paland <marco@paland.com> | 2018-11-02 14:00:03 +0100 |
---|---|---|
committer | Marco Paland <marco@paland.com> | 2018-11-02 14:00:03 +0100 |
commit | 54dfd185432d300746a8586cd3e620d5eb178a5d (patch) | |
tree | 10720771a853e351438ea99c05ca6b1fe3195f95 /printf.c | |
parent | cc8f3bc050042270c661c0807d6555c242e0b244 (diff) | |
download | printf-54dfd185432d300746a8586cd3e620d5eb178a5d.tar.gz printf-54dfd185432d300746a8586cd3e620d5eb178a5d.tar.bz2 printf-54dfd185432d300746a8586cd3e620d5eb178a5d.zip |
feat(printf): added PRINTF_OVERRIDE_LIBC support
Fixes #16
Diffstat (limited to 'printf.c')
-rw-r--r-- | printf.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -699,8 +699,11 @@ static int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen, const ///////////////////////////////////////////////////////////////////////////////
-
+#ifndef PRINTF_OVERRIDE_LIBC
int printf(const char* format, ...)
+#else
+int printf_(const char* format, ...)
+#endif
{
va_list va;
va_start(va, format);
@@ -711,7 +714,11 @@ int printf(const char* format, ...) }
+#ifndef PRINTF_OVERRIDE_LIBC
int sprintf(char* buffer, const char* format, ...)
+#else
+int sprintf_(char* buffer, const char* format, ...)
+#endif
{
va_list va;
va_start(va, format);
@@ -721,7 +728,11 @@ int sprintf(char* buffer, const char* format, ...) }
+#ifndef PRINTF_OVERRIDE_LIBC
int snprintf(char* buffer, size_t count, const char* format, ...)
+#else
+int snprintf_(char* buffer, size_t count, const char* format, ...)
+#endif
{
va_list va;
va_start(va, format);
@@ -731,13 +742,21 @@ int snprintf(char* buffer, size_t count, const char* format, ...) }
+#ifndef PRINTF_OVERRIDE_LIBC
int vsnprintf(char* buffer, size_t count, const char* format, va_list va)
+#else
+int vsnprintf_(char* buffer, size_t count, const char* format, va_list va)
+#endif
{
return _vsnprintf(_out_buffer, buffer, count, format, va);
}
+#ifndef PRINTF_OVERRIDE_LIBC
int fctprintf(void (*out)(char character, void* arg), void* arg, const char* format, ...)
+#else
+int fctprintf_(void (*out)(char character, void* arg), void* arg, const char* format, ...)
+#endif
{
va_list va;
va_start(va, format);
|