-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
safestringlib: add version to the library.
The library exports macros SAFEC_VERSION and SAFEC_VERSION_STRING macros. The shared library is versioned too. Signed-off-by: Tomas Winkler <[email protected]>
- Loading branch information
Tomas Winkler
committed
Nov 24, 2021
1 parent
999ee37
commit 88d4f87
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
* Modified 2012, Jonathan Toppins <[email protected]> | ||
* | ||
* Copyright (c) 2008-2013 by Cisco Systems, Inc | ||
* Copyright (c) 2021 by Intel Corp | ||
* All rights reserved. | ||
* | ||
* Permission is hereby granted, free of charge, to any person | ||
|
@@ -37,6 +38,18 @@ | |
extern "C" { | ||
#endif | ||
|
||
/* Define safe_lib version number */ | ||
#define SAFEC_VERSION_MAJOR 1 | ||
#define SAFEC_VERSION_MINOR 1 | ||
#define SAFEC_VERSION_PATCH 0 | ||
#define SAFEC_VERSION_STRING "1.1.0" | ||
|
||
#define SAFEC_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) | ||
#define SAFEC_VERSION \ | ||
SAFEC_VERSION_NUM(SAFEC_VERSION_MAJOR, \ | ||
SAFEC_VERSION_MINOR, \ | ||
SAFEC_VERSION_PATCH) | ||
|
||
#include "safe_types.h" | ||
#include "safe_lib_errno.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-License-Identifier: MIT | ||
# Copyright (C) 2021 Intel Corporation | ||
|
||
file(READ "include/safe_lib.h" VER_FILE) | ||
|
||
string(REGEX MATCH "SAFEC_VERSION_MAJOR ([0-9]*)" _ ${VER_FILE}) | ||
set(SAFEC_VERSION_MAJOR ${CMAKE_MATCH_1}) | ||
|
||
string(REGEX MATCH "SAFEC_VERSION_MINOR ([0-9]*)" _ ${VER_FILE}) | ||
set(SAFEC_VERSION_MINOR ${CMAKE_MATCH_1}) | ||
|
||
string(REGEX MATCH "SAFEC_VERSION_PATCH ([0-9]*)" _ ${VER_FILE}) | ||
set(SAFEC_VERSION_PATCH ${CMAKE_MATCH_1}) | ||
|
||
set(SAFEC_VERSION_STRING | ||
${SAFEC_VERSION_MAJOR}.${SAFEC_VERSION_MINOR}.${SAFEC_VERSION_PATCH}) |