Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ OPTION (MSGPACK_CXX11 "Using c++11 compiler" OFF)
OPTION (MSGPACK_32BIT "32bit compile" OFF)
OPTION (MSGPACK_BOOST "Using boost libraries" OFF)

SET (CMAKE_CXX_FLAGS "-DMSGPACK_DISABLE_LEGACY_NIL ${CMAKE_CXX_FLAGS}")

IF (APPLE)
SET(CMAKE_MACOSX_RPATH ON)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
Expand Down
8 changes: 6 additions & 2 deletions QUICKSTART-CPP.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ int main(void) {
Compile it as follows:

```
$ g++ hello.cc -o hello
$ g++ -Ipath_to_msgpack/include -DMSGPACK_DISABLE_LEGACY_NIL hello.cc -o hello
$ ./hello
["Hello", "MessagePack"]
```

See [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140).

## Streaming feature

```cpp
Expand Down Expand Up @@ -83,14 +85,16 @@ int main(void) {
}

// results:
// $ g++ stream.cc -o stream
// $ g++ -Ipath_to_msgpack/include -DMSGPACK_DISABLE_LEGACY_NIL stream.cc -o stream
// $ ./stream
// "Log message ... 1"
// "Log message ... 2"
// "Log message ... 3"
}
```

See [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140).

### Streaming into an array or map

```cpp
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ Usage
When you use msgpack on C++03 and C++11, you can just add
msgpack-c/include to your include path:

g++ -I msgpack-c/include your_source_file.cpp
g++ -I msgpack-c/include -DMSGPACK_DISABLE_LEGACY_NIL your_source_file.cpp

See [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140).

If you want to use C version of msgpack, you need to build it. You can
also install the C and C++ versions of msgpack.
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AM_CPPFLAGS = -I$(top_srcdir)/include -pthread
AM_CPPFLAGS = -I$(top_srcdir)/include -pthread -DMSGPACK_DISABLE_LEGACY_NIL
AM_C_CPPFLAGS = -I$(top_srcdir)/include -pthread
AM_LDFLAGS = $(top_builddir)/src/libmsgpackc.la -lgtest_main -lgtest -lpthread

Expand Down