diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:29:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 16:29:01 +0000 |
commit | 35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch) | |
tree | 657d15a03cc46bd099fc2c6546a7a4ad43815d9f /src/3rdparty/autotrace/logreport.h | |
parent | Initial commit. (diff) | |
download | inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip |
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/3rdparty/autotrace/logreport.h')
-rw-r--r-- | src/3rdparty/autotrace/logreport.h | 32 |
1 files changed, 32 insertions, 0 deletions
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 <stdio.h> +#include "types.h" +#include <stdlib.h> + +#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 */ |