File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ OPTION (MSGPACK_CXX11 "Using c++11 compiler" OFF)
2121OPTION (MSGPACK_32BIT "32bit compile" OFF )
2222OPTION (MSGPACK_BOOST "Using boost libraries" OFF )
2323
24+ SET (CMAKE_CXX_FLAGS "-DMSGPACK_DISABLE_LEGACY_NIL ${CMAKE_CXX_FLAGS} " )
25+
2426IF (APPLE )
2527 SET (CMAKE_MACOSX_RPATH ON )
2628 SET (CMAKE_SKIP_BUILD_RPATH FALSE )
Original file line number Diff line number Diff line change @@ -47,11 +47,13 @@ int main(void) {
4747Compile 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
Original file line number Diff line number Diff line change @@ -112,7 +112,9 @@ Usage
112112When you use msgpack on C++03 and C++11, you can just add
113113msgpack-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
117119If you want to use C version of msgpack, you need to build it. You can
118120also install the C and C++ versions of msgpack.
Original file line number Diff line number Diff line change 1- AM_CPPFLAGS = -I$(top_srcdir ) /include -pthread
1+ AM_CPPFLAGS = -I$(top_srcdir ) /include -pthread -DMSGPACK_DISABLE_LEGACY_NIL
22AM_C_CPPFLAGS = -I$(top_srcdir ) /include -pthread
33AM_LDFLAGS = $(top_builddir ) /src/libmsgpackc.la -lgtest_main -lgtest -lpthread
44
You can’t perform that action at this time.
0 commit comments