-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #459 from marcalff/fix_version_header
Add version number in header files
- Loading branch information
Showing
9 changed files
with
117 additions
and
1 deletion.
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
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,27 @@ | ||
#include "c4/yml/version.hpp" | ||
|
||
namespace c4 { | ||
namespace yml { | ||
|
||
csubstr version() | ||
{ | ||
return RYML_VERSION; | ||
} | ||
|
||
int version_major() | ||
{ | ||
return RYML_VERSION_MAJOR; | ||
} | ||
|
||
int version_minor() | ||
{ | ||
return RYML_VERSION_MINOR; | ||
} | ||
|
||
int version_patch() | ||
{ | ||
return RYML_VERSION_PATCH; | ||
} | ||
|
||
} // namespace yml | ||
} // namespace c4 |
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,25 @@ | ||
#ifndef _C4_YML_VERSION_HPP_ | ||
#define _C4_YML_VERSION_HPP_ | ||
|
||
/** @file version.hpp */ | ||
|
||
#define RYML_VERSION "0.7.0" | ||
#define RYML_VERSION_MAJOR 0 | ||
#define RYML_VERSION_MINOR 7 | ||
#define RYML_VERSION_PATCH 0 | ||
|
||
#include <c4/substr.hpp> | ||
#include <c4/yml/export.hpp> | ||
|
||
namespace c4 { | ||
namespace yml { | ||
|
||
RYML_EXPORT csubstr version(); | ||
RYML_EXPORT int version_major(); | ||
RYML_EXPORT int version_minor(); | ||
RYML_EXPORT int version_patch(); | ||
|
||
} // namespace yml | ||
} // namespace c4 | ||
|
||
#endif /* _C4_YML_VERSION_HPP_ */ |
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef RYML_SINGLE_HEADER | ||
#include "c4/yml/version.hpp" | ||
#endif | ||
#include "./test_lib/test_case.hpp" | ||
#include <gtest/gtest.h> | ||
|
||
TEST(version, str) | ||
{ | ||
c4::csubstr v = c4::yml::version(); | ||
EXPECT_GE(v.len, 5); | ||
} | ||
|
||
TEST(version, major) | ||
{ | ||
int v = c4::yml::version_major(); | ||
EXPECT_GE(v, 0); | ||
} | ||
|
||
TEST(version, minor) | ||
{ | ||
int v = c4::yml::version_minor(); | ||
EXPECT_GE(v, 0); | ||
} | ||
|
||
TEST(version, patch) | ||
{ | ||
int v = c4::yml::version_patch(); | ||
EXPECT_GE(v, 0); | ||
} |
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