Skip to content

Commit 83ab53e

Browse files
committed
Merge pull request #412 from redboltz/add_disable_legacy_macros_for_build
Added MSGPACK_DISABLE_LEGACY_NIL to build system and documents.
2 parents 13afc54 + ba73841 commit 83ab53e

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ OPTION (MSGPACK_CXX11 "Using c++11 compiler" OFF)
2121
OPTION (MSGPACK_32BIT "32bit compile" OFF)
2222
OPTION (MSGPACK_BOOST "Using boost libraries" OFF)
2323

24+
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DISABLE_LEGACY_NIL ${CMAKE_CXX_FLAGS}")
25+
2426
IF (APPLE)
2527
SET(CMAKE_MACOSX_RPATH ON)
2628
SET(CMAKE_SKIP_BUILD_RPATH FALSE)

QUICKSTART-CPP.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ int main(void) {
4747
Compile it as follows:
4848
4949
```
50-
$ g++ hello.cc -o hello
50+
$ g++ -Ipath_to_msgpack/include -DMSGPACK_DISABLE_LEGACY_NIL hello.cc -o hello
5151
$ ./hello
5252
["Hello", "MessagePack"]
5353
```
5454
55+
See [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140).
56+
5557
## Streaming feature
5658
5759
```cpp
@@ -83,14 +85,16 @@ int main(void) {
8385
}
8486
8587
// results:
86-
// $ g++ stream.cc -o stream
88+
// $ g++ -Ipath_to_msgpack/include -DMSGPACK_DISABLE_LEGACY_NIL stream.cc -o stream
8789
// $ ./stream
8890
// "Log message ... 1"
8991
// "Log message ... 2"
9092
// "Log message ... 3"
9193
}
9294
```
9395

96+
See [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140).
97+
9498
### Streaming into an array or map
9599

96100
```cpp

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ Usage
112112
When you use msgpack on C++03 and C++11, you can just add
113113
msgpack-c/include to your include path:
114114

115-
g++ -I msgpack-c/include your_source_file.cpp
115+
g++ -I msgpack-c/include -DMSGPACK_DISABLE_LEGACY_NIL your_source_file.cpp
116+
117+
See [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140).
116118

117119
If you want to use C version of msgpack, you need to build it. You can
118120
also install the C and C++ versions of msgpack.

test/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AM_CPPFLAGS = -I$(top_srcdir)/include -pthread
1+
AM_CPPFLAGS = -I$(top_srcdir)/include -pthread -DMSGPACK_DISABLE_LEGACY_NIL
22
AM_C_CPPFLAGS = -I$(top_srcdir)/include -pthread
33
AM_LDFLAGS = $(top_builddir)/src/libmsgpackc.la -lgtest_main -lgtest -lpthread
44

0 commit comments

Comments
 (0)