From 00a2bdc307df1284ed592abdef396c05d6019c54 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Mon, 1 Nov 2021 09:40:37 +0000 Subject: [PATCH] Remove all use of N2N_VERSION_SHORT in favor of PACKAGE_VERSION --- CMakeLists.txt | 8 ++++---- src/n2n.c | 2 +- src/sn_utils.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afa7e76..3252dd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,9 +9,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) execute_process( COMMAND cat VERSION WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE N2N_VERSION + OUTPUT_VARIABLE PACKAGE_VERSION ) -string(STRIP "${N2N_VERSION}" N2N_VERSION) +string(STRIP "${PACKAGE_VERSION}" PACKAGE_VERSION) set(N2N_OSNAME ${CMAKE_SYSTEM_NAME}) execute_process( COMMAND git status @@ -37,8 +37,8 @@ MESSAGE(STATUS "Build from git rev: ${N2N_VERSION}") endif (GIT_ERROR_CODE EQUAL 0) add_definitions(-DCMAKE_BUILD) -add_definitions(-DPACKAGE_VERSION="${N2N_VERSION}" -DPACKAGE_OSNAME="${N2N_OSNAME}") -add_definitions(-DN2N_VERSION="${N2N_VERSION}" -DN2N_OSNAME="${N2N_OSNAME}") +add_definitions(-DPACKAGE_OSNAME="${N2N_OSNAME}") +add_definitions(-DPACKAGE_VERSION="${PACKAGE_VERSION}" -DN2N_OSNAME="${N2N_OSNAME}") # Build information diff --git a/src/n2n.c b/src/n2n.c index 902b218..d48e182 100644 --- a/src/n2n.c +++ b/src/n2n.c @@ -590,7 +590,7 @@ void print_n2n_version () { printf("Welcome to n2n v.%s for %s\n" "Built on %s\n" "Copyright 2007-2021 - ntop.org and contributors\n\n", - N2N_VERSION, PACKAGE_OSNAME, PACKAGE_BUILDDATE); + PACKAGE_VERSION, PACKAGE_OSNAME, PACKAGE_BUILDDATE); } /* *********************************************** */ diff --git a/src/sn_utils.c b/src/sn_utils.c index 6148b48..464eb9e 100644 --- a/src/sn_utils.c +++ b/src/sn_utils.c @@ -741,7 +741,7 @@ int sn_init_defaults (n2n_sn_t *sss) { memset(sss, 0, sizeof(n2n_sn_t)); - strncpy(sss->version, N2N_VERSION, sizeof(n2n_version_t)); + strncpy(sss->version, PACKAGE_VERSION, sizeof(n2n_version_t)); sss->version[sizeof(n2n_version_t) - 1] = '\0'; sss->daemon = 1; /* By defult run as a daemon. */ sss->lport = N2N_SN_LPORT_DEFAULT;