From: Alberto Leiva Popper Date: Wed, 27 Feb 2019 17:18:44 +0000 (-0600) Subject: Ease compilation on OpenBSD X-Git-Tag: v0.0.2~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e0843d18f2501aa9f12f410f3eabcf0ca9f537b;p=thirdparty%2FFORT-validator.git Ease compilation on OpenBSD Looks like OpenBSD's compiler is about a decade old. GNU11 is not supported. Also fix warning on debug disabled. --- diff --git a/src/Makefile.am b/src/Makefile.am index 09fa0613..299bf18a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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. diff --git a/src/log.c b/src/log.c index 54fb1e7f..fe729740 100644 --- 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 */ diff --git a/src/log.h b/src/log.h index 549ba816..466a4cfc 100644 --- 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