Commit 3fa66372 authored by Adam Wujek's avatar Adam Wujek 💬

sw:rt:lib: check HAS_* against a value instead of existence of CONFIG_

By this one, we are sure that generated/autoconf.h is included
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 437a4891
......@@ -35,7 +35,7 @@
* @param[in] ... argument according to the string format
* @return number of printed characters
*/
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
#if HAS_MOCKTURTLE_LIBRARY_PRINT_ENABLE == 1
extern int pp_printf(const char *fmt, ...)
__attribute__((format(printf,1,2)));
#else
......@@ -53,7 +53,7 @@ static inline int pp_printf(const char *fmt, ...)
* @param[in] ... argument according to the string format
* @return number of printed characters
*/
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
#if HAS_MOCKTURTLE_LIBRARY_PRINT_ENABLE == 1
extern int pp_sprintf(char *s, const char *fmt, ...)
__attribute__((format(printf,2,3)));
#else
......@@ -71,7 +71,7 @@ static inline int pp_sprintf(char *s, const char *fmt, ...)
* @param[in] args list of arguments according to the string format
* @return number of printed characters
*/
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
#if HAS_MOCKTURTLE_LIBRARY_PRINT_ENABLE
extern int pp_vprintf(const char *fmt, va_list args);
#else
static inline int pp_vprintf(const char *fmt, va_list args)
......@@ -88,7 +88,7 @@ static inline int pp_vprintf(const char *fmt, va_list args)
* @param[in] args list of arguments according to the string format
* @return number of printed characters
*/
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
#if HAS_MOCKTURTLE_LIBRARY_PRINT_ENABLE == 1
extern int pp_vsprintf(char *buf, const char *, va_list args)
__attribute__ ((format (printf, 2, 0)));
#else
......@@ -110,7 +110,7 @@ static inline int pp_vsprintf(char *buf, const char *fmt, va_list args)
* @param[in] ... argument according to the string format
* @return number of printed characters
*/
#if defined(CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE) && defined(CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE)
#if (HAS_MOCKTURTLE_LIBRARY_PRINT_ENABLE == 1) && (HAS_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE == 1)
extern int pr_debug(const char *fmt, ...)
__attribute__((format(printf,1,2)));
#else
......@@ -131,7 +131,7 @@ static inline int pr_debug(const char *fmt, ...)
* @param[in] ... argument according to the string format
* @return number of printed characters
*/
#if defined(CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE) && defined(CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE)
#if (HAS_MOCKTURTLE_LIBRARY_PRINT_ENABLE == 1) && (HAS_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE == 1)
extern int pr_error(const char *fmt, ...)
__attribute__((format(printf,1,2)));
#else
......
......@@ -14,7 +14,7 @@
#include <mockturtle-rt-common.h>
#include <mockturtle-rt-serial.h>
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
#if HAS_MOCKTURTLE_LIBRARY_PRINT_ENABLE == 1
static char print_buf[CONFIG_PRINT_BUFSIZE];
......@@ -51,7 +51,7 @@ int pp_printf(const char *fmt, ...)
return ret;
}
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE
#if HAS_MOCKTURTLE_LIBRARY_PRINT_ERROR_ENABLE == 1
int pr_error(const char *fmt, ...)
{
va_list args;
......@@ -67,7 +67,7 @@ int pr_error(const char *fmt, ...)
}
#endif
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE
#if HAS_MOCKTURTLE_LIBRARY_PRINT_DEBUG_ENABLE == 1
int pr_debug(const char *fmt, ...)
{
va_list args;
......
......@@ -13,7 +13,7 @@
#include <stdint.h>
#include <generated/autoconf.h>
#ifdef CONFIG_MOCKTURTLE_LIBRARY_PRINT_ENABLE
#if HAS_MOCKTURTLE_LIBRARY_PRINT_ENABLE == 1
static const char hex[] = "0123456789abcdef";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment