-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to first major version 1.0.0 (#60)
Added static_assert to verify composed version string matches the individual version components
- Loading branch information
Showing
2 changed files
with
22 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <stddef.h> | ||
#include <assert.h> | ||
|
||
#include "version.h" | ||
|
||
#define STATIC_ASSERT(COND,MSG) typedef char static_assertion[(COND)?1:-1] | ||
|
||
#define STRINGIFY(x) #x | ||
#define TOSTRING(x) STRINGIFY(x) | ||
#define LIBRDB_COMPOSED_VERSION_STRING TOSTRING(LIBRDB_MAJOR_VERSION) "." \ | ||
TOSTRING(LIBRDB_MINOR_VERSION) "." \ | ||
TOSTRING(LIBRDB_PATCH_VERSION) | ||
|
||
/* Verify that the composed version string matches the individual version components */ | ||
STATIC_ASSERT( | ||
(sizeof(LIBRDB_VERSION_STRING) == sizeof(LIBRDB_COMPOSED_VERSION_STRING)) && | ||
(__builtin_strcmp(LIBRDB_VERSION_STRING, LIBRDB_COMPOSED_VERSION_STRING) == 0), | ||
"LIBRDB_VERSION_STRING does not match the individual version components" | ||
); |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#define LIBRDB_MAJOR_VERSION 0 | ||
#define LIBRDB_MAJOR_VERSION 1 | ||
#define LIBRDB_MINOR_VERSION 0 | ||
#define LIBRDB_PATCH_VERSION 1 | ||
#define LIBRDB_PATCH_VERSION 0 | ||
|
||
/* Keep direct value for external readers */ | ||
#define LIBRDB_VERSION_STRING "0.0.1" | ||
#define LIBRDB_VERSION_STRING "1.0.0" | ||
|
||
/* Update Maximum supported RDB version */ | ||
#define LIBRDB_SUPPORT_MAX_RDB_VER 12 |