Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
5ab1e936
Commit
5ab1e936
authored
Apr 21, 2015
by
miloyip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add version macros for RapidJSON
parent
8d39282a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
7 deletions
+39
-7
CMakeLists.txt
CMakeLists.txt
+2
-2
rapidjson.h
include/rapidjson/rapidjson.h
+34
-5
unittest.cpp
test/unittest/unittest.cpp
+3
-0
No files found.
CMakeLists.txt
View file @
5ab1e936
...
...
@@ -3,8 +3,8 @@ SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
PROJECT
(
RapidJSON CXX
)
set
(
LIB_MAJOR_VERSION
"
0
"
)
set
(
LIB_MINOR_VERSION
"
12
"
)
set
(
LIB_MAJOR_VERSION
"
1
"
)
set
(
LIB_MINOR_VERSION
"
0
"
)
set
(
LIB_PATCH_VERSION
"0"
)
set
(
LIB_VERSION_STRING
"
${
LIB_MAJOR_VERSION
}
.
${
LIB_MINOR_VERSION
}
.
${
LIB_PATCH_VERSION
}
"
)
...
...
include/rapidjson/rapidjson.h
View file @
5ab1e936
...
...
@@ -17,7 +17,7 @@
/*!\file rapidjson.h
\brief common definitions and configuration
\see RAPIDJSON_CONFIG
*/
...
...
@@ -39,6 +39,39 @@
#include <cstdlib> // malloc(), realloc(), free(), size_t
#include <cstring> // memset(), memcpy(), memmove(), memcmp()
///////////////////////////////////////////////////////////////////////////////
// RAPIDJSON_VERSION_STRING
//
// ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt.
//
//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
// token stringification
#define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x)
#define RAPIDJSON_DO_STRINGIFY(x) #x
//!@endcond
/*! \def RAPIDJSON_MAJOR_VERSION
\ingroup RAPIDJSON_CONFIG
\brief Major version of RapidJSON in integer.
*/
/*! \def RAPIDJSON_MINOR_VERSION
\ingroup RAPIDJSON_CONFIG
\brief Minor version of RapidJSON in integer.
*/
/*! \def RAPIDJSON_PATCH_VERSION
\ingroup RAPIDJSON_CONFIG
\brief Patch version of RapidJSON in integer.
*/
/*! \def RAPIDJSON_VERSION_STRING
\ingroup RAPIDJSON_CONFIG
\brief Version of RapidJSON in "<major>.<minor>.<patch>" string format.
*/
#define RAPIDJSON_MAJOR_VERSION 1
#define RAPIDJSON_MINOR_VERSION 0
#define RAPIDJSON_PATCH_VERSION 0
#define RAPIDJSON_VERSION_STRING RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION) "." RAPIDJSON_STRINGIFY(RAPIDJSON_MINOR_VERSION) "." RAPIDJSON_STRINGIFY(RAPIDJSON_PATCH_VERSION)
///////////////////////////////////////////////////////////////////////////////
// RAPIDJSON_NAMESPACE_(BEGIN|END)
/*! \def RAPIDJSON_NAMESPACE
...
...
@@ -353,10 +386,6 @@ RAPIDJSON_NAMESPACE_END
#define RAPIDJSON_VERSION_CODE(x,y,z) \
(((
x
)
*
100000
)
+
((
y
)
*
100
)
+
(
z
))
// token stringification
#define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x)
#define RAPIDJSON_DO_STRINGIFY(x) #x
///////////////////////////////////////////////////////////////////////////////
// RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF
...
...
test/unittest/unittest.cpp
View file @
5ab1e936
...
...
@@ -13,10 +13,13 @@
// specific language governing permissions and limitations under the License.
#include "unittest.h"
#include "rapidjson/rapidjson.h"
int
main
(
int
argc
,
char
**
argv
)
{
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
std
::
cout
<<
"RapidJSON v"
<<
RAPIDJSON_VERSION_STRING
<<
std
::
endl
;
#if _MSC_VER
_CrtMemState
memoryState
=
{
0
};
_CrtMemCheckpoint
(
&
memoryState
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment