Making macros include-safe

This commit is contained in:
Sergio Martin 2024-01-29 17:04:29 +01:00
parent 2d17b39772
commit beaa6bfd25
1 changed files with 11 additions and 6 deletions

View File

@ -5,14 +5,19 @@
#include <stdio.h>
// If we use NCurses, we need to use the appropriate printing function
#ifdef NCURSES
#include <ncurses.h>
#define LOG printw
#else
#define LOG printf
#ifndef LOG
#ifdef NCURSES
#include <ncurses.h>
#define LOG printw
#else
#define LOG printf
#endif
#endif
#ifndef EXIT_WITH_ERROR
#define EXIT_WITH_ERROR(...) exitWithError(__FILE__, __LINE__, __VA_ARGS__)
#endif
#define EXIT_WITH_ERROR(...) exitWithError(__FILE__, __LINE__, __VA_ARGS__)
inline void exitWithError [[noreturn]] (const char *fileName, const int lineNumber, const char *format, ...)
{
char *outstr = 0;