From b739848b6ea4c038610ceb7c0b00984a86d99fa9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Aug 2021 13:47:10 -0400 Subject: Add version constants to public header --- src/serd_config.h | 3 --- src/serdi.c | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/serd_config.h b/src/serd_config.h index e6b3aa4b..909a357d 100644 --- a/src/serd_config.h +++ b/src/serd_config.h @@ -35,9 +35,6 @@ #ifndef SERD_SRC_SERD_CONFIG_H #define SERD_SRC_SERD_CONFIG_H -// Define version unconditionally so a warning will catch a mismatch -#define SERD_VERSION "1.1.1" - #if !defined(SERD_NO_DEFAULT_CONFIG) // We need unistd.h to check _POSIX_VERSION diff --git a/src/serdi.c b/src/serdi.c index 27e6d782..d3ff0813 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -13,6 +13,7 @@ #include "serd/status.h" #include "serd/syntax.h" #include "serd/uri.h" +#include "serd/version.h" #include "serd/writer.h" #ifdef _WIN32 @@ -79,11 +80,16 @@ guess_syntax(const char* const filename) static int print_version(void) { - printf("serdi " SERD_VERSION " \n"); + printf("serdi %d.%d.%d \n", + SERD_MAJOR_VERSION, + SERD_MINOR_VERSION, + SERD_MICRO_VERSION); + printf("Copyright 2011-2023 David Robillard .\n" "License ISC: .\n" "This is free software; you are free to change and redistribute it." "\nThere is NO WARRANTY, to the extent permitted by law.\n"); + return 0; } -- cgit v1.2.1