]> git.ipfire.org Git - thirdparty/FORT-validator.git/commitdiff
Ease compilation on OpenBSD
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 27 Feb 2019 17:18:44 +0000 (11:18 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Wed, 27 Feb 2019 17:18:44 +0000 (11:18 -0600)
Looks like OpenBSD's compiler is about a decade old. GNU11 is not
supported.

Also fix warning on debug disabled.

src/Makefile.am
src/log.c
src/log.h

index 09fa0613fbd03a25e2d37b9e593bd26b903c6ee1..299bf18a92f0356705b06c86de71d4bbbd07f0ab 100644 (file)
@@ -55,7 +55,7 @@ rpki_validator_SOURCES += resource/asn.h resource/asn.c
 rpki_validator_CFLAGS  = -Wall
 # Feel free to temporarily remove this one if you're not using gcc 7.3.0.
 rpki_validator_CFLAGS += $(GCC_WARNS)
-rpki_validator_CFLAGS += -std=gnu11 -O0 -g $(CFLAGS_DEBUG)
+rpki_validator_CFLAGS += -std=gnu99 -O0 -g $(CFLAGS_DEBUG)
 rpki_validator_LDFLAGS = $(LDFLAGS_DEBUG)
 
 # I'm tired of scrolling up, but feel free to comment this out.
index 54fb1e7f157827922440d98229778a1715eb0e91..fe7297402588c98beaad9ff6d937a3ccb0cbf4fa 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -6,7 +6,10 @@
 #include "config.h"
 #include "thread_var.h"
 
+#ifdef DEBUG
 #define COLOR_DEBUG    "\x1B[36m"      /* Cyan */
+#endif
+
 #define COLOR_INFO     "\x1B[37m"      /* Gray */
 #define COLOR_WARNING  "\x1B[33m"      /* Yellow */
 #define COLOR_ERROR    "\x1B[31m"      /* Red */
index 549ba816a25337c3012a965403f975e9c09fa867..466a4cfc3bdc96edbe0d91093514be1abbece9eb 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -34,9 +34,20 @@ void pr_debug_suffix(void);
 
 #else
 
-#define pr_debug(...)
-#define pr_debug_add(...)
-#define pr_debug_rm(...)
+/*
+ * I want to define these as empty, but then we get compiler warnings on
+ *
+ * ```
+ * else
+ *     pr_debug(...);
+ * ```
+ *
+ * Oh well.
+ */
+
+#define pr_debug(...) do {} while (0)
+#define pr_debug_add(...) do {} while (0)
+#define pr_debug_rm(...) do {} while (0)
 
 #endif