From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- src/3rdparty/autotrace/logreport.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/3rdparty/autotrace/logreport.h (limited to 'src/3rdparty/autotrace/logreport.h') diff --git a/src/3rdparty/autotrace/logreport.h b/src/3rdparty/autotrace/logreport.h new file mode 100644 index 0000000..04a548c --- /dev/null +++ b/src/3rdparty/autotrace/logreport.h @@ -0,0 +1,32 @@ +/* logreport.h: status reporting routines. */ + +#ifndef LOGREPORT_H +#define LOGREPORT_H + +#include +#include "types.h" +#include + +#ifdef _EXPORTING +#define DECLSPEC __declspec(dllexport) +#elif _IMPORTING +#define DECLSPEC __declspec(dllimport) +#else +#define DECLSPEC +#endif + +/* Whether to write a log */ +extern gboolean logging; + +#define LOG(...) \ + do { if (logging) fprintf (stdout, __VA_ARGS__); } while (0) + +/* Define common sorts of messages. */ + +#define FATAL(...) \ + do { fputs ("fatal: ", stderr); LOG("fatal: "); fprintf (stderr, __VA_ARGS__); LOG (__VA_ARGS__); fputs (".\n", stderr); exit (1); } while (0) + +#define WARNING(...) \ + do { fputs ("warning: ", stderr); LOG ("warning: "); fprintf (stderr, __VA_ARGS__); LOG (__VA_ARGS__); fputs (".\n", stderr); } while (0) + +#endif /* not LOGREPORT_H */ -- cgit v1.2.3