Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefix macro VERSION #882

Merged
merged 2 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ set(re_DIR ${CMAKE_CURRENT_LIST_DIR}/cmake)
find_package(re CONFIG REQUIRED)

list(APPEND RE_DEFINITIONS
-DVERSION="${PROJECT_VERSION_FULL}"
-DRE_VERSION="${PROJECT_VERSION_FULL}"
-DVER_MAJOR=${PROJECT_VERSION_MAJOR}
-DVER_MINOR=${PROJECT_VERSION_MINOR}
-DVER_PATCH=${PROJECT_VERSION_PATCH}
Expand Down
4 changes: 2 additions & 2 deletions include/re_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
#include <stdio.h>

#ifndef VERSION
#define VERSION "?"
#ifndef RE_VERSION
#define RE_VERSION "?"
#endif

/**
Expand Down
6 changes: 3 additions & 3 deletions src/http/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#define DEBUG_LEVEL 5
#include <re_dbg.h>

#ifndef VERSION
#define VERSION "???"
#ifndef RE_VERSION
#define RE_VERSION "???"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version string is re-defined here ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this looks strange, better to include re_sys.h

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I add a commit.

#endif


Expand Down Expand Up @@ -358,7 +358,7 @@ static int send_req(struct http_reqconn *conn, const struct pl *auth)
(conn->bodyh || conn->body) ? req_body_handler : NULL,
conn,
"%r%s"
"User-Agent: re " VERSION "\r\n"
"User-Agent: re " RE_VERSION "\r\n"
"%r"
"%r"
"%r"
Expand Down
2 changes: 1 addition & 1 deletion src/ice/stunsrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <re_dbg.h>


static const char *sw = "ice stunsrv v" VERSION " (" ARCH "/" OS ")";
static const char *sw = "ice stunsrv v" RE_VERSION " (" ARCH "/" OS ")";


static void triggered_check(struct icem *icem, struct ice_cand *lcand,
Expand Down
2 changes: 1 addition & 1 deletion src/stun/stun.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "stun.h"


const char *stun_software = "libre v" VERSION " (" ARCH "/" OS ")";
const char *stun_software = "libre v" RE_VERSION " (" ARCH "/" OS ")";


static const struct stun_conf conf_default = {
Expand Down
4 changes: 2 additions & 2 deletions src/sys/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ const char *sys_os_get(void)
*/
const char *sys_libre_version_get(void)
{
#ifdef VERSION
return VERSION;
#ifdef RE_VERSION
return RE_VERSION;
#else
return "?";
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/trice/stunsrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <re_dbg.h>


static const char *sw = "ice stunsrv v" VERSION " (" ARCH "/" OS ")";
static const char *sw = "ice stunsrv v" RE_VERSION " (" ARCH "/" OS ")";


/*
Expand Down