msgpack / msgpack-c

MessagePack implementation for C and C++ / msgpack.org[C/C++]
Other
3.03k stars 883 forks source link

plateform dependancy #512

Open mikapak opened 8 years ago

mikapak commented 8 years ago

I want to use msgpack -c in embedded system project where CPU is stm32f4 and I can't use windows or linux files. getting error with os dependent file. Could anyone help me to port msgpack-c in non os platform.

redboltz commented 8 years ago

Memory allocation

msgpack-c uses malloc, realloc, free, new, and delete. You need to port them.

Locking

msgpack-c uses C++11's atomic or __gnu_cxx::__exchange_and_add See https://github.com/msgpack/msgpack-c/blob/224a830ce07fa629a757dade0abead2203e276df/include/msgpack/v1/unpack.hpp#L308

https://github.com/msgpack/msgpack-c/blob/83dbe398fdec15d9c56dee4e9447ceb98f823072/include/msgpack/gcc_atomic.hpp

As far as I can remember, they are platform dependent code. If you want to use without them, you need to modify code or introduce some macros.

NOTE

msgpack.hpp includes most of header files of msgpack-c. You might not need all of them. You can include individual header file to minimize platform dependency. For example, you might not need STL container adaptor support.