2020-01-18 08:38:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 08:38:21 +00:00
|
|
|
*/
|
|
|
|
|
2018-10-16 12:33:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-06-18 06:53:26 +00:00
|
|
|
#ifdef __serenity__
|
2020-05-16 10:00:04 +00:00
|
|
|
# ifdef KERNEL
|
|
|
|
# include <Kernel/kstdio.h>
|
2020-02-15 18:18:56 +00:00
|
|
|
# else
|
|
|
|
# include <AK/Types.h>
|
2020-08-06 11:36:06 +00:00
|
|
|
# include <stdarg.h>
|
2020-02-15 18:18:56 +00:00
|
|
|
extern "C" {
|
2022-04-01 17:58:27 +00:00
|
|
|
void dbgputstr(char const*, size_t);
|
|
|
|
int sprintf(char* buf, char const* fmt, ...) __attribute__((format(printf, 2, 3)));
|
|
|
|
int snprintf(char* buffer, size_t, char const* fmt, ...) __attribute__((format(printf, 3, 4)));
|
2020-02-15 18:18:56 +00:00
|
|
|
}
|
|
|
|
# endif
|
2019-06-18 06:53:26 +00:00
|
|
|
#else
|
2020-02-15 18:18:56 +00:00
|
|
|
# include <stdio.h>
|
2022-04-01 17:58:27 +00:00
|
|
|
inline void dbgputstr(char const* characters, size_t length)
|
2020-08-09 02:45:20 +00:00
|
|
|
{
|
2020-10-04 15:42:31 +00:00
|
|
|
fwrite(characters, 1, length, stderr);
|
2020-08-09 02:45:20 +00:00
|
|
|
}
|
2019-06-18 06:53:26 +00:00
|
|
|
#endif
|
2020-08-09 02:45:20 +00:00
|
|
|
template<size_t N>
|
2022-04-01 17:58:27 +00:00
|
|
|
inline void dbgputstr(char const (&array)[N])
|
2020-08-09 02:45:20 +00:00
|
|
|
{
|
|
|
|
return ::dbgputstr(array, N);
|
|
|
|
}
|