From 0b26cb712c7fc1de7189b5bb9c5ae869df73f6d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 4 May 2024 13:14:36 +0300 Subject: [PATCH] INOTIFYINFO_VERSION: be stricter requiring it. Having thought about it more, one safeguard in the Makefile is enough. We should be more explicit about required arguments when compiling, and especially given it's trivial to set anyway. --- Makefile | 2 +- inotify-info.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0018cad..717dc28 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ endif CFLAGS = $(WARNINGS) -march=native -fno-exceptions -gdwarf-4 -g2 -ggnu-pubnames -gsplit-dwarf CFLAGS += -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -CFLAGS += -DVERSION=\"$(INOTIFYINFO_VERSION)\" +CFLAGS += -DINOTIFYINFO_VERSION=\"$(INOTIFYINFO_VERSION)\" CXXFLAGS = -fno-rtti -Woverloaded-virtual LDFLAGS = -march=native -gdwarf-4 -g2 -Wl,--build-id=sha1 LIBS = -Wl,--no-as-needed -lm -ldl -lpthread -lstdc++ diff --git a/inotify-info.cpp b/inotify-info.cpp index 77b14af..ae5e61e 100644 --- a/inotify-info.cpp +++ b/inotify-info.cpp @@ -52,8 +52,8 @@ #include "inotify-info.h" #include "lfqueue/lfqueue.h" -#ifndef VERSION -#define VERSION "unknown" +#ifndef INOTIFYINFO_VERSION +#error INOTIFYINFO_VERSION must be set #endif /* @@ -992,7 +992,7 @@ static bool parse_ignore_dirs_file() static void print_version() { - printf("%s\n", VERSION); + printf("%s\n", INOTIFYINFO_VERSION); } static void print_usage(const char* appname)