From 5ab1e9361db34edfb228e6d7df81e1842ef7b4ab Mon Sep 17 00:00:00 2001 From: miloyip Date: Tue, 21 Apr 2015 16:38:49 +0800 Subject: Add version macros for RapidJSON --- CMakeLists.txt | 4 ++-- include/rapidjson/rapidjson.h | 39 ++++++++++++++++++++++++++++++++++----- test/unittest/unittest.cpp | 3 +++ 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c823ac3..94919f04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/include/rapidjson/rapidjson.h b/include/rapidjson/rapidjson.h index 4351aeae..021468b3 100644 --- a/include/rapidjson/rapidjson.h +++ b/include/rapidjson/rapidjson.h @@ -17,7 +17,7 @@ /*!\file rapidjson.h \brief common definitions and configuration - + \see RAPIDJSON_CONFIG */ @@ -39,6 +39,39 @@ #include // malloc(), realloc(), free(), size_t #include // 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 ".." 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 diff --git a/test/unittest/unittest.cpp b/test/unittest/unittest.cpp index c475179e..4e3bc11e 100644 --- a/test/unittest/unittest.cpp +++ b/test/unittest/unittest.cpp @@ -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); -- cgit v1.2.3 From 95c6ec97c419da7832db28f5b1a01f6cdc0580ab Mon Sep 17 00:00:00 2001 From: miloyip Date: Tue, 21 Apr 2015 17:28:31 +0800 Subject: Add release badge to readmes --- readme.md | 3 +++ readme.zh-cn.md | 2 ++ 2 files changed, 5 insertions(+) diff --git a/readme.md b/readme.md index 8a7264f9..007596a4 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,7 @@ ![](doc/logo/rapidjson.png) + +![](https://img.shields.io/badge/release-v1.0.0-blue.png) + ## A fast JSON parser/generator for C++ with both SAX/DOM style API Tencent is pleased to support the open source community by making RapidJSON available. diff --git a/readme.zh-cn.md b/readme.zh-cn.md index 91ab10dd..be3849a7 100644 --- a/readme.zh-cn.md +++ b/readme.zh-cn.md @@ -1,5 +1,7 @@ ![](doc/logo/rapidjson.png) +![](https://img.shields.io/badge/release-v1.0.0-blue.png) + Tencent is pleased to support the open source community by making RapidJSON available. Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. -- cgit v1.2.3 From 5ab3f69910ce33b6aed5d8de5ff56c2c6b277f88 Mon Sep 17 00:00:00 2001 From: miloyip Date: Wed, 22 Apr 2015 09:19:18 +0800 Subject: Simplify RAPIDJSON_VERSION_STRING --- include/rapidjson/rapidjson.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/rapidjson/rapidjson.h b/include/rapidjson/rapidjson.h index 021468b3..938a3ce4 100644 --- a/include/rapidjson/rapidjson.h +++ b/include/rapidjson/rapidjson.h @@ -70,7 +70,8 @@ #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) +#define RAPIDJSON_VERSION_STRING \ + RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION) /////////////////////////////////////////////////////////////////////////////// // RAPIDJSON_NAMESPACE_(BEGIN|END) -- cgit v1.2.3 From b2e53523bf4a12fe120ceaa16e3b5c7da1672f41 Mon Sep 17 00:00:00 2001 From: miloyip Date: Wed, 22 Apr 2015 09:24:56 +0800 Subject: Change version in appveyor --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index d1a91089..890f9d9a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.12.{build} +version: 1.0.0.{build} configuration: - Debug -- cgit v1.2.3