From 43628f6f7dbbbc9ab566037479a4f8c0cff108d0 Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Thu, 26 Jun 2014 14:52:29 +0200 Subject: [PATCH 1/2] prepare for travis-ci.org continuous integration Travis CI is a free hosted continuous integration platform for open-source projects. It allows automated testing for GitHub-hosted projects. This commit adds a corresponding `.travis.yml` configuration file. --- .travis.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..efa96e5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +language: cpp + +compiler: + - clang + - gcc + +env: + - config=debug64 config_suffix=debug_x64_gmake + - config=release64 config_suffix=release_x64_gmake + +before_install: + - sudo add-apt-repository -y ppa:codegear/release + - sudo apt-get update -qq + - sudo apt-get install -y premake4 + +install: true + +before_script: + - cd build + - premake4 'gmake' + - cd "${TRAVIS_BUILD_DIR}" + +script: + - make -C build/gmake -f test.make unittest + - cd bin + - ./unittest_${config_suffix} From cc8833506c4b7b94f3c9f0d01d8afe3fd50325af Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Thu, 26 Jun 2014 16:06:15 +0200 Subject: [PATCH 2/2] document.h: define __STDC_CONSTANT_MACROS The C++ standard does not include the C99 macros used to set the (U)INT64 constants in document.h and reader.h (see adf66292 and ce1fece2). Many implementations include their definition when the __STDC_CONSTANT_MACROS preprocessor symbol is defined. See e.g. http://www.cprogramdevelop.com/5272623/, needed to successfully build in travis-ci.org's environment. --- include/rapidjson/rapidjson.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/rapidjson/rapidjson.h b/include/rapidjson/rapidjson.h index 30fd7a1..fd31aef 100644 --- a/include/rapidjson/rapidjson.h +++ b/include/rapidjson/rapidjson.h @@ -10,13 +10,19 @@ /////////////////////////////////////////////////////////////////////////////// // RAPIDJSON_NO_INT64DEFINE -// Here defines int64_t and uint64_t types in global namespace. +// Here defines int64_t and uint64_t types in global namespace as well as the +// (U)INT64_C constant macros. // If user have their own definition, can define RAPIDJSON_NO_INT64DEFINE to disable this. #ifndef RAPIDJSON_NO_INT64DEFINE +#ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS 1 // required by C++ standard +#endif #ifdef _MSC_VER +#include "msinttypes/stdint.h" #include "msinttypes/inttypes.h" #else // Other compilers should have this. +#include #include #endif #endif // RAPIDJSON_NO_INT64TYPEDEF