mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-21 07:45:02 +02:00
Compare commits
216 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b065560404 | ||
![]() |
93b41492fe | ||
![]() |
c1b3d7530f | ||
![]() |
ca9f25b51e | ||
![]() |
860f7fce55 | ||
![]() |
76f5af0593 | ||
![]() |
d04b1e7549 | ||
![]() |
0fddfe8058 | ||
![]() |
78814311cb | ||
![]() |
073394cbba | ||
![]() |
25d6f84f3c | ||
![]() |
4022c2fc00 | ||
![]() |
7b7615a6d9 | ||
![]() |
0af15e45de | ||
![]() |
18ec42ccac | ||
![]() |
be4d971c62 | ||
![]() |
3feac1f51d | ||
![]() |
2b78d50d13 | ||
![]() |
77045f13bb | ||
![]() |
388891edad | ||
![]() |
fc3de9806e | ||
![]() |
54b2b23b25 | ||
![]() |
b9381f842e | ||
![]() |
90677eb58c | ||
![]() |
dfbfd927b4 | ||
![]() |
e487321ed6 | ||
![]() |
7c7f45fbea | ||
![]() |
7707c81c5d | ||
![]() |
a66da75bd4 | ||
![]() |
3944993686 | ||
![]() |
6b6a05e07c | ||
![]() |
6c8ec25016 | ||
![]() |
04726a5acf | ||
![]() |
44aa90eb50 | ||
![]() |
ab36ce2654 | ||
![]() |
780c504c44 | ||
![]() |
d852e6e4fb | ||
![]() |
65938a95e9 | ||
![]() |
b9d06fe207 | ||
![]() |
555cd3ff68 | ||
![]() |
e88fa26f7a | ||
![]() |
0d203644be | ||
![]() |
d53d42a791 | ||
![]() |
14763a8b31 | ||
![]() |
70912ffde4 | ||
![]() |
6598c6228f | ||
![]() |
eb1e7e6e07 | ||
![]() |
544978b343 | ||
![]() |
c8a053557c | ||
![]() |
71687c4229 | ||
![]() |
3557e6c9f9 | ||
![]() |
0e22de17b1 | ||
![]() |
b0860a5f37 | ||
![]() |
447e8dfb07 | ||
![]() |
8ee6df83cc | ||
![]() |
0168468ac8 | ||
![]() |
ee29324fd5 | ||
![]() |
194d1a470d | ||
![]() |
ebb5e0ceca | ||
![]() |
f72c6c48f7 | ||
![]() |
fc18087cdf | ||
![]() |
da2fc25f87 | ||
![]() |
4629583662 | ||
![]() |
c7b7e745b3 | ||
![]() |
899d3319bf | ||
![]() |
6eaf7fd38d | ||
![]() |
01260a263d | ||
![]() |
30ed4e35b7 | ||
![]() |
44f2a6a56e | ||
![]() |
3b80c45725 | ||
![]() |
6b197e7328 | ||
![]() |
498fe28b43 | ||
![]() |
ad9106e38b | ||
![]() |
7ca4ec95e5 | ||
![]() |
2f5b137997 | ||
![]() |
328be0b445 | ||
![]() |
689e6d053a | ||
![]() |
6e7deb8091 | ||
![]() |
66fa561256 | ||
![]() |
243fb27c3c | ||
![]() |
746e983bf3 | ||
![]() |
766afb90ed | ||
![]() |
403567c1c5 | ||
![]() |
f3fe1b801e | ||
![]() |
4fdbc7518f | ||
![]() |
0dbdb3d974 | ||
![]() |
d7d5be414f | ||
![]() |
4d36456799 | ||
![]() |
b1725d4007 | ||
![]() |
102dba8e24 | ||
![]() |
1a372058a6 | ||
![]() |
f8b691f622 | ||
![]() |
7893d4d8c9 | ||
![]() |
9a3cd0c951 | ||
![]() |
46684265d5 | ||
![]() |
9e0d87b725 | ||
![]() |
bbc03b2b0a | ||
![]() |
b4d28c3d9d | ||
![]() |
cc1098998f | ||
![]() |
d9c5978958 | ||
![]() |
d05daa1df6 | ||
![]() |
534466894e | ||
![]() |
d04520044f | ||
![]() |
c0fb6b3b8c | ||
![]() |
19df3314f4 | ||
![]() |
b530b7f21a | ||
![]() |
ed49ea3c95 | ||
![]() |
7918c19f8f | ||
![]() |
0d7caecdb5 | ||
![]() |
f8b0ad1766 | ||
![]() |
7ed7af90b6 | ||
![]() |
4a94f836a7 | ||
![]() |
b36e548db2 | ||
![]() |
e6c276edf3 | ||
![]() |
befc3cdd0c | ||
![]() |
2e2e93ba2e | ||
![]() |
3b2bb56243 | ||
![]() |
9c4562382b | ||
![]() |
08b0c88c21 | ||
![]() |
d105f97ea0 | ||
![]() |
bd0665bed3 | ||
![]() |
8dc865d92d | ||
![]() |
8085ab8721 | ||
![]() |
b36e75a42e | ||
![]() |
f17f8d79c4 | ||
![]() |
f89f05b883 | ||
![]() |
bd5f814cb2 | ||
![]() |
bf6cc035c7 | ||
![]() |
a6bf728a5c | ||
![]() |
698a482b67 | ||
![]() |
fbf5b9d74c | ||
![]() |
65c35caab2 | ||
![]() |
ff9f14742b | ||
![]() |
4b4eb83cd1 | ||
![]() |
7761497778 | ||
![]() |
6046d5c666 | ||
![]() |
83eb70d718 | ||
![]() |
70f950ac05 | ||
![]() |
3129326432 | ||
![]() |
799cd15107 | ||
![]() |
942965ee87 | ||
![]() |
a123053823 | ||
![]() |
c7603fbbd1 | ||
![]() |
6954e01338 | ||
![]() |
7e23ec496a | ||
![]() |
bae148bd76 | ||
![]() |
3fcecf7099 | ||
![]() |
7d994630d2 | ||
![]() |
29b9505cb7 | ||
![]() |
e07d774004 | ||
![]() |
ff77227e10 | ||
![]() |
de99222801 | ||
![]() |
7cdc5b88e3 | ||
![]() |
fbdf16db09 | ||
![]() |
41b2af8884 | ||
![]() |
9389912eaf | ||
![]() |
d5242a7d8c | ||
![]() |
d3fecce359 | ||
![]() |
7a70d74971 | ||
![]() |
fcf89fe901 | ||
![]() |
ec8c0bc1c1 | ||
![]() |
a2f3689865 | ||
![]() |
2d54c0e918 | ||
![]() |
ce088e7e0a | ||
![]() |
a1b86507da | ||
![]() |
9235d1acae | ||
![]() |
12172e7dc7 | ||
![]() |
6a08446b3d | ||
![]() |
c93a42b5f4 | ||
![]() |
8febbfd9f5 | ||
![]() |
33a8d8c30f | ||
![]() |
ef5bcadd95 | ||
![]() |
fadc615f4e | ||
![]() |
eff6f5a2fd | ||
![]() |
ed30252bdc | ||
![]() |
2deed25da0 | ||
![]() |
419877cf3a | ||
![]() |
17267ed475 | ||
![]() |
b759f5bdf7 | ||
![]() |
f72372314e | ||
![]() |
530561eec0 | ||
![]() |
aec88c06a0 | ||
![]() |
09e06a8cb7 | ||
![]() |
084db3fcf1 | ||
![]() |
709d6f4fdd | ||
![]() |
27cf578e8c | ||
![]() |
7001679959 | ||
![]() |
daa78b4606 | ||
![]() |
b893f7750c | ||
![]() |
8792f42f8d | ||
![]() |
4f9ec65713 | ||
![]() |
db54c78ed4 | ||
![]() |
1155babda8 | ||
![]() |
83a82e3eb5 | ||
![]() |
aa9c73352c | ||
![]() |
df9e003b35 | ||
![]() |
f6ddc9b85a | ||
![]() |
11cfeeec92 | ||
![]() |
d72765870a | ||
![]() |
349c133171 | ||
![]() |
c056026dad | ||
![]() |
0421dabc1e | ||
![]() |
60930f4b12 | ||
![]() |
b3dfe28be4 | ||
![]() |
e703d8a2f7 | ||
![]() |
801f61c12c | ||
![]() |
a3e75a0709 | ||
![]() |
92d34cbd79 | ||
![]() |
c99fd62ae6 | ||
![]() |
a3986b3bdc | ||
![]() |
7fed49e6fe | ||
![]() |
005e06e00a | ||
![]() |
b6d4bb5cb0 | ||
![]() |
f57bfd998b | ||
![]() |
e8d3387a04 | ||
![]() |
53d2ea9ad3 |
72
.github/depends/boost.sh
vendored
Executable file
72
.github/depends/boost.sh
vendored
Executable file
@@ -0,0 +1,72 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
cat <<EOL
|
||||||
|
-b - 32-bit or 64-bit library, maybe 32, 64 or both
|
||||||
|
-t - the toolset, maybe gcc, clang or both
|
||||||
|
-p - installation prefix
|
||||||
|
EOL
|
||||||
|
}
|
||||||
|
|
||||||
|
build_boost()
|
||||||
|
{
|
||||||
|
./b2 \
|
||||||
|
--toolset=$1 \
|
||||||
|
--prefix=$3/$2 \
|
||||||
|
--with-test \
|
||||||
|
--with-headers \
|
||||||
|
--with-chrono \
|
||||||
|
--with-context \
|
||||||
|
--with-filesystem \
|
||||||
|
--with-system \
|
||||||
|
--with-timer \
|
||||||
|
address-model=$2 \
|
||||||
|
install || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
bit="64"
|
||||||
|
toolset="gcc"
|
||||||
|
prefix="$HOME/boost-prefix"
|
||||||
|
|
||||||
|
while getopts "b:t:p:" c; do
|
||||||
|
case "$c" in
|
||||||
|
b)
|
||||||
|
bit="$OPTARG"
|
||||||
|
[ "$bit" != "32" ] && [ "$bit" != "64" ] && [ "$bit" != "both" ] && usage && exit 1
|
||||||
|
;;
|
||||||
|
t)
|
||||||
|
toolset="$OPTARG"
|
||||||
|
[ "$toolset" != "gcc" ] && [ "$toolset" != "clang" ] && [ "$toolset" != "both" ] && usage && exit 1
|
||||||
|
;;
|
||||||
|
p)
|
||||||
|
prefix="$OPTARG"
|
||||||
|
;;
|
||||||
|
?*)
|
||||||
|
echo "invalid arguments." && exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir $prefix || exit 1
|
||||||
|
wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 || exit 1
|
||||||
|
tar xf boost_1_76_0.tar.bz2 || exit 1
|
||||||
|
cd boost_1_76_0
|
||||||
|
./bootstrap.sh || exit 1
|
||||||
|
|
||||||
|
build()
|
||||||
|
{
|
||||||
|
if [ "$bit" = "both" ]; then
|
||||||
|
build_boost $1 32 $prefix
|
||||||
|
build_boost $1 64 $prefix
|
||||||
|
else
|
||||||
|
build_boost $1 $bit $prefix
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$toolset" = "both" ]; then
|
||||||
|
build gcc
|
||||||
|
build clang
|
||||||
|
else
|
||||||
|
build $toolset
|
||||||
|
fi
|
51
.github/depends/zlib.sh
vendored
Executable file
51
.github/depends/zlib.sh
vendored
Executable file
@@ -0,0 +1,51 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
usage()
|
||||||
|
{
|
||||||
|
cat <<EOL
|
||||||
|
-b - 32-bit or 64-bit library, maybe 32 or 64
|
||||||
|
-p - installation prefix
|
||||||
|
EOL
|
||||||
|
}
|
||||||
|
|
||||||
|
bit="64"
|
||||||
|
prefix="$HOME/zlib-prefix"
|
||||||
|
|
||||||
|
while getopts "b:t:p:" c; do
|
||||||
|
case "$c" in
|
||||||
|
b)
|
||||||
|
bit="$OPTARG"
|
||||||
|
[ "$bit" != "32" ] && [ "$bit" != "64" ] && [ "$bit" != "both" ] && usage && exit 1
|
||||||
|
;;
|
||||||
|
p)
|
||||||
|
prefix="$OPTARG"
|
||||||
|
;;
|
||||||
|
?*)
|
||||||
|
echo "invalid arguments." && exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir $prefix || exit 1
|
||||||
|
wget https://zlib.net/zlib-1.2.11.tar.gz || exit 1
|
||||||
|
tar -xf zlib-1.2.11.tar.gz || exit 1
|
||||||
|
cd zlib-1.2.11
|
||||||
|
|
||||||
|
build()
|
||||||
|
{
|
||||||
|
cmake \
|
||||||
|
-D CMAKE_BUILD_TYPE=Release \
|
||||||
|
-D CMAKE_INSTALL_PREFIX=$2/$1 \
|
||||||
|
-D CMAKE_C_FLAGS="-m$1" \
|
||||||
|
-D CMAKE_SHARED_LINKER_FLAGS="-m$1" \
|
||||||
|
-B build$1 \
|
||||||
|
-S .
|
||||||
|
cmake --build build$1 --target install
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$bit" = "both" ]; then
|
||||||
|
build 32 $prefix
|
||||||
|
build 64 $prefix
|
||||||
|
else
|
||||||
|
build $bit $prefix
|
||||||
|
fi
|
73
.github/workflows/coverage.yml
vendored
Normal file
73
.github/workflows/coverage.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
name: coverage
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize]
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- cpp_master
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
codecov:
|
||||||
|
timeout-minutes: 30
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Install build dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install g++-10 cmake lcov -y
|
||||||
|
./ci/set_gcc_10.sh
|
||||||
|
|
||||||
|
- name: Cache boost
|
||||||
|
id: cache-boost
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/boost-prefix/
|
||||||
|
key: ${{ runner.os }}-boost-64-1-76-0-2021-08-09
|
||||||
|
|
||||||
|
- name: Build boost
|
||||||
|
if: steps.cache-boost.outputs.cache-hit != 'true'
|
||||||
|
run: ./.github/depends/boost.sh -b 64 -t gcc -p $HOME/boost-prefix
|
||||||
|
|
||||||
|
- name: Cache zlib
|
||||||
|
id: cache-zlib
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/zlib-prefix/
|
||||||
|
key: ${{ runner.os }}-zlib-64-1-2-11-2021-08-09
|
||||||
|
|
||||||
|
- name: Build zlib
|
||||||
|
if: steps.cache-zlib.outputs.cache-hit != 'true'
|
||||||
|
run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix
|
||||||
|
|
||||||
|
- name: Compile tests
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cmake \
|
||||||
|
-D MSGPACK_CXX20=ON \
|
||||||
|
-D MSGPACK_32BIT=OFF \
|
||||||
|
-D MSGPACK_CHAR_SIGN=signed \
|
||||||
|
-D MSGPACK_USE_X3_PARSE=ON \
|
||||||
|
-D MSGPACK_BUILD_EXAMPLES=ON \
|
||||||
|
-D MSGPACK_BUILD_TESTS=ON \
|
||||||
|
-D CMAKE_BUILD_TYPE=Debug \
|
||||||
|
-D MSGPACK_GEN_COVERAGE=ON \
|
||||||
|
-D CMAKE_PREFIX_PATH="$HOME/zlib-prefix/64;$HOME/boost-prefix/64" \
|
||||||
|
-B build \
|
||||||
|
-S . || exit 1
|
||||||
|
cmake --build build --target all || exit 1
|
||||||
|
ctest --test-dir build || exit 1
|
||||||
|
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
working-directory: build
|
||||||
|
run: |
|
||||||
|
# Create lcov report
|
||||||
|
lcov --capture --directory . --output-file coverage.info
|
||||||
|
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
|
||||||
|
lcov --list coverage.info # debug info
|
||||||
|
# Uploading report to CodeCov
|
||||||
|
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
|
236
.github/workflows/gha.yml
vendored
Normal file
236
.github/workflows/gha.yml
vendored
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize]
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- cpp_master
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
macos:
|
||||||
|
name: ${{ format('macOS (pattern {0})', matrix.pattern) }}
|
||||||
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
pattern: [0, 1, 2, 3, 4]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Cache boost
|
||||||
|
id: cache-boost
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/boost-prefix/
|
||||||
|
key: ${{ runner.os }}-boost-1-76-0-2021-08-09
|
||||||
|
|
||||||
|
- name: Build boost
|
||||||
|
if: steps.cache-boost.outputs.cache-hit != 'true'
|
||||||
|
run: ./.github/depends/boost.sh -b 64 -t clang -p $HOME/boost-prefix
|
||||||
|
|
||||||
|
- name: Cache zlib
|
||||||
|
id: cache-zlib
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/zlib-prefix/
|
||||||
|
key: ${{ runner.os }}-zlib-1-2-11-2021-08-09
|
||||||
|
|
||||||
|
- name: Build zlib
|
||||||
|
if: steps.cache-zlib.outputs.cache-hit != 'true'
|
||||||
|
run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix
|
||||||
|
|
||||||
|
- name: Build and test
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# default configuration - overwrite its params later depending on matrix.pattern
|
||||||
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
|
||||||
|
export ARCH=64
|
||||||
|
export API_VERSION=3
|
||||||
|
export CHAR_SIGN="signed"
|
||||||
|
export X3_PARSE="OFF"
|
||||||
|
export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all"
|
||||||
|
|
||||||
|
case ${{ matrix.pattern }} in
|
||||||
|
0)
|
||||||
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=OFF"
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
export API_VERSION=1
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
export API_VERSION=2
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
export X3_PARSE="ON"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
export CHAR_SIGN="unsigned"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# build and test
|
||||||
|
export CXX="clang++"
|
||||||
|
CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE}" ci/build_cmake.sh || exit 1
|
||||||
|
|
||||||
|
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
|
||||||
|
|
||||||
|
linux:
|
||||||
|
name: ${{ format('Linux (pattern {0})', matrix.pattern) }}
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
pattern: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install g++-10 cmake valgrind -y
|
||||||
|
sudo apt-get install g++-10-multilib -y # for 32-bit compile
|
||||||
|
./ci/set_gcc_10.sh
|
||||||
|
|
||||||
|
- name: Cache boost
|
||||||
|
id: cache-boost
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/boost-prefix/
|
||||||
|
key: ${{ runner.os }}-boost-1-76-0-2021-08-09
|
||||||
|
|
||||||
|
- name: Build boost
|
||||||
|
if: steps.cache-boost.outputs.cache-hit != 'true'
|
||||||
|
run: ./.github/depends/boost.sh -b both -t gcc -p $HOME/boost-prefix
|
||||||
|
|
||||||
|
- name: Cache zlib
|
||||||
|
id: cache-zlib
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/zlib-prefix/
|
||||||
|
key: ${{ runner.os }}-zlib-1-2-11-2021-08-09
|
||||||
|
|
||||||
|
- name: Build zlib
|
||||||
|
if: steps.cache-zlib.outputs.cache-hit != 'true'
|
||||||
|
run: ./.github/depends/zlib.sh -b both -p $HOME/zlib-prefix
|
||||||
|
|
||||||
|
- name: Build and test
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# default configuration - overwrite its params later depending on matrix.pattern
|
||||||
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
|
||||||
|
export ARCH=64
|
||||||
|
export API_VERSION=3
|
||||||
|
export CHAR_SIGN="signed"
|
||||||
|
export X3_PARSE="OFF"
|
||||||
|
export SANITIZE="-fsanitize=undefined -fno-sanitize-recover=all"
|
||||||
|
export ACTION="ci/build_cmake.sh"
|
||||||
|
|
||||||
|
case ${{ matrix.pattern }} in
|
||||||
|
0)
|
||||||
|
export CXX="clang++-10"
|
||||||
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=OFF"
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
export CXX="g++-10"
|
||||||
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX11=ON"
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
export CXX="clang++-10"
|
||||||
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX14=ON"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
export CXX="g++-10"
|
||||||
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX17=ON"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
export CXX="clang++-10"
|
||||||
|
export MSGPACK_CXX_VERSION="MSGPACK_CXX20=ON"
|
||||||
|
;;
|
||||||
|
5)
|
||||||
|
export CXX="g++-10"
|
||||||
|
export ARCH=32
|
||||||
|
;;
|
||||||
|
6)
|
||||||
|
export CXX="clang++-10"
|
||||||
|
export API_VERSION=2
|
||||||
|
;;
|
||||||
|
7)
|
||||||
|
export CXX="g++-10"
|
||||||
|
export API_VERSION=1
|
||||||
|
;;
|
||||||
|
8)
|
||||||
|
export CXX="clang++-10"
|
||||||
|
export CHAR_SIGN="unsigned"
|
||||||
|
;;
|
||||||
|
9)
|
||||||
|
export CXX="g++-10"
|
||||||
|
export X3_PARSE="ON"
|
||||||
|
;;
|
||||||
|
10)
|
||||||
|
export CXX="clang++-10"
|
||||||
|
export ACTION="ci/build_regression.sh"
|
||||||
|
;;
|
||||||
|
11)
|
||||||
|
export CXX="g++-10"
|
||||||
|
export ARCH=32
|
||||||
|
export CHAR_SIGN="unsigned"
|
||||||
|
export X3_PARSE="ON"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# build and test
|
||||||
|
CMAKE_CXX_COMPILER="$CXX" CXXFLAGS="-Werror -g ${SANITIZE}" ci/build_cmake.sh || exit 1
|
||||||
|
cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
|
||||||
|
|
||||||
|
windows:
|
||||||
|
name: ${{ format('Windows cxx{0}', matrix.cxx) }}
|
||||||
|
runs-on: windows-2019
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
# MSVC2019 only supports /std:c++14, /std:c++17 and /std:c++latest
|
||||||
|
cxx: [14, 17, 20]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Cache vcpkg dependencies
|
||||||
|
id: cache-vcpkg
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: C:/vcpkg/installed/x64-windows
|
||||||
|
key: ${{ runner.os }}-vcpkg-2021-08-09
|
||||||
|
|
||||||
|
- name: Install vcpkg dependencies
|
||||||
|
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
vcpkg update
|
||||||
|
vcpkg install zlib:x64-windows
|
||||||
|
vcpkg install boost:x64-windows
|
||||||
|
|
||||||
|
- name: Build and test
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
$CPPVER="MSGPACK_CXX${{ matrix.cxx }}=ON"
|
||||||
|
|
||||||
|
md build
|
||||||
|
cmake `
|
||||||
|
-A x64 `
|
||||||
|
-G "Visual Studio 16 2019" `
|
||||||
|
-D CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" `
|
||||||
|
-D MSGPACK_BUILD_TESTS=ON `
|
||||||
|
-D $CPPVER `
|
||||||
|
-D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /D_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING /D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING /W3 /WX" `
|
||||||
|
-B build `
|
||||||
|
-S .
|
||||||
|
if ($LastExitCode -ne 0) { exit $LastExitCode }
|
||||||
|
|
||||||
|
cmake --build build --config Release
|
||||||
|
if ($LastExitCode -ne 0) { exit $LastExitCode }
|
||||||
|
|
||||||
|
ctest -VV --test-dir build -C Release
|
||||||
|
if ($LastExitCode -ne 0) { exit $LastExitCode }
|
6
.gitmodules
vendored
6
.gitmodules
vendored
@@ -1,6 +0,0 @@
|
|||||||
[submodule "external/boost/predef"]
|
|
||||||
path = external/boost/predef
|
|
||||||
url = https://github.com/boostorg/predef.git
|
|
||||||
[submodule "external/boost/preprocessor"]
|
|
||||||
path = external/boost/preprocessor
|
|
||||||
url = https://github.com/boostorg/preprocessor.git
|
|
239
.travis.yml
239
.travis.yml
@@ -1,239 +0,0 @@
|
|||||||
language: cpp
|
|
||||||
sudo: false
|
|
||||||
dist: trusty
|
|
||||||
|
|
||||||
install:
|
|
||||||
- export BASE=`pwd`
|
|
||||||
- mkdir ${BASE}/usr
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget --no-check-certificate https://cmake.org/files/v3.7/cmake-3.7.1-Linux-x86_64.sh -O cmake-3.7.1-Linux-x86_64.sh; fi
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then chmod a+x cmake-3.7.1-Linux-x86_64.sh; fi
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ./cmake-3.7.1-Linux-x86_64.sh --prefix=${BASE}/usr --skip-license; fi
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH="${BASE}/usr/bin:$PATH"; fi
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export LD_LIBRARY_PATH="${BASE}/usr/lib:$LD_LIBRARY_PATH"; fi
|
|
||||||
- if [ "$CXX" == "g++" ]; then export CXX="g++-7" CC="gcc-7"; fi
|
|
||||||
- if [ "$CXX" == "clang++" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then export CXX="clang++-5.0" CC="clang-5.0"; fi
|
|
||||||
- if [ "$CXX" == "g++" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then cd /usr/include/c++/$(g++ -v 2>&1 | grep version | awk '{print $3}')/bits; ln -s ../ext/atomicity.h .; cd ${BASE}/usr; fi
|
|
||||||
#gtest
|
|
||||||
- wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip
|
|
||||||
- unzip -q googletest-release-1.7.0.zip
|
|
||||||
- cd googletest-release-1.7.0
|
|
||||||
- $CXX -m${ARCH} src/gtest-all.cc -I. -Iinclude -c
|
|
||||||
- $CXX -m${ARCH} src/gtest_main.cc -I. -Iinclude -c
|
|
||||||
- ar -rv libgtest.a gtest-all.o
|
|
||||||
- ar -rv libgtest_main.a gtest_main.o
|
|
||||||
- mkdir -p ${BASE}/usr/include
|
|
||||||
- cp -r include/gtest ${BASE}/usr/include
|
|
||||||
- mkdir -p ${BASE}/usr/lib
|
|
||||||
- mv *.a ${BASE}/usr/lib
|
|
||||||
- cd ..
|
|
||||||
# valgrind
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$MSGPACK_FUZZ_REGRESSION" != "ON" ]; then wget http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2 && tar xjf valgrind-3.12.0.tar.bz2 && cd valgrind-3.12.0 && ./configure --prefix=${BASE}/usr > /dev/null && make -j3 > /dev/null && make install > /dev/null && cd ..; fi
|
|
||||||
# boost
|
|
||||||
- if [ "$BOOST" == "ON" ] && [ "MSGPACK_FUZZ_REGRESSION" != "ON" ]; then wget http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.zip && unzip -q boost_1_67_0.zip && cd boost_1_67_0 && ./bootstrap.sh && ./b2 -j3 --prefix=${BASE}/usr --with-chrono --with-context --with-system --with-timer address-model=${ARCH} install > /dev/null && cd ..; fi
|
|
||||||
- if [ "$MSGPACK_FUZZ_REGRESSION" == "ON" ]; then wget http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.zip && unzip -q boost_1_67_0.zip && cd boost_1_67_0 && ./bootstrap.sh --with-toolset=clang && ./b2 clean && ./b2 -j$(nproc) --prefix=${BASE}/usr --with-system --with-filesystem address-model=${ARCH} install > /dev/null && cd ..; fi
|
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo ln -s /usr/include/x86_64-linux-gnu/zconf.h /usr/include; fi
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: osx
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_cmake.sh" CXX17="ON" ARCH="64" BOOST="ON" SHARED="ON" CHAR_SIGN="unsigned" API_VERSION="1"
|
|
||||||
- os: osx
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_cmake.sh" CXX17="ON" ARCH="64" BOOST="ON" SHARED="ON" CHAR_SIGN="signed" API_VERSION="3"
|
|
||||||
- os: osx
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_cmake.sh" CXX17="ON" ARCH="64" SHARED="ON" CHAR_SIGN="signed" API_VERSION="2"
|
|
||||||
- os: osx
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_cmake.sh" ARCH="64" SHARED="ON" CHAR_SIGN="unsigned" API_VERSION="2"
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_cmake.sh" ARCH="64" BOOST="ON" SHARED="ON" CHAR_SIGN="unsigned" API_VERSION="1"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-trusty-5.0
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-7-multilib
|
|
||||||
- g++-7-multilib
|
|
||||||
- bzip2
|
|
||||||
- clang-5.0
|
|
||||||
- libc6-dbg
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_cmake.sh" ARCH="32" SHARED="ON" CHAR_SIGN="signed" API_VERSION="2"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-trusty-5.0
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-7-multilib
|
|
||||||
- g++-7-multilib
|
|
||||||
- lib32stdc++6-6-dbg
|
|
||||||
- lib32gcc1
|
|
||||||
- libc6-i386
|
|
||||||
- lib32z1-dev
|
|
||||||
- zlib1g-dev
|
|
||||||
- bzip2
|
|
||||||
- clang-5.0
|
|
||||||
- libc6-dbg
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_cmake.sh" CXX17="ON" ARCH="64" BOOST="ON" SHARED="ON" CHAR_SIGN="signed" API_VERSION="3" X3_PARSE="ON"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-trusty-5.0
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-7-multilib
|
|
||||||
- g++-7-multilib
|
|
||||||
- bzip2
|
|
||||||
- clang-5.0
|
|
||||||
- libc6-dbg
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_cmake.sh" CXX17="ON" ARCH="32" SHARED="OFF" CHAR_SIGN="unsigned" API_VERSION="2"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-trusty-5.0
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-7-multilib
|
|
||||||
- g++-7-multilib
|
|
||||||
- lib32stdc++6-6-dbg
|
|
||||||
- lib32gcc1
|
|
||||||
- libc6-i386
|
|
||||||
- lib32z1-dev
|
|
||||||
- zlib1g-dev
|
|
||||||
- bzip2
|
|
||||||
- clang-5.0
|
|
||||||
- libc6-dbg
|
|
||||||
- os: linux
|
|
||||||
compiler: gcc
|
|
||||||
env: ACTION="ci/build_cmake.sh" CXX17="ON" ARCH="64" SHARED="ON" CHAR_SIGN="signed" API_VERSION="2"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-7-multilib
|
|
||||||
- g++-7-multilib
|
|
||||||
- bzip2
|
|
||||||
- libc6-dbg
|
|
||||||
- os: linux
|
|
||||||
compiler: gcc
|
|
||||||
env: ACTION="ci/build_cmake.sh" CXX17="ON" ARCH="32" BOOST="ON" SHARED="ON" CHAR_SIGN="unsigned" API_VERSION="3" X3_PARSE="ON"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-7-multilib
|
|
||||||
- g++-7-multilib
|
|
||||||
- lib32stdc++6-6-dbg
|
|
||||||
- lib32gcc1
|
|
||||||
- libc6-i386
|
|
||||||
- lib32z1-dev
|
|
||||||
- zlib1g-dev
|
|
||||||
- bzip2
|
|
||||||
- libc6-dbg
|
|
||||||
- os: linux
|
|
||||||
compiler: gcc
|
|
||||||
env: ACTION="ci/build_cmake.sh" ARCH="64" SHARED="ON" CHAR_SIGN="unsigned" API_VERSION="2"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-7-multilib
|
|
||||||
- g++-7-multilib
|
|
||||||
- bzip2
|
|
||||||
- libc6-dbg
|
|
||||||
- os: linux
|
|
||||||
compiler: gcc
|
|
||||||
env: ACTION="ci/build_cmake.sh" ARCH="32" BOOST="ON" SHARED="OFF" CHAR_SIGN="signed" API_VERSION="1"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-7-multilib
|
|
||||||
- g++-7-multilib
|
|
||||||
- lib32stdc++6-6-dbg
|
|
||||||
- lib32gcc1
|
|
||||||
- libc6-i386
|
|
||||||
- lib32z1-dev
|
|
||||||
- zlib1g-dev
|
|
||||||
- bzip2
|
|
||||||
- libc6-dbg
|
|
||||||
- os: linux
|
|
||||||
compiler: gcc
|
|
||||||
env: ACTION="ci/build_cmake.sh" ARCH="32" BOOST="ON" SHARED="OFF" CHAR_SIGN="signed" API_VERSION="2"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
packages:
|
|
||||||
- g++-multilib
|
|
||||||
- gcc-multilib
|
|
||||||
- gcc-7-multilib
|
|
||||||
- g++-7-multilib
|
|
||||||
- lib32stdc++6-6-dbg
|
|
||||||
- lib32gcc1
|
|
||||||
- libc6-i386
|
|
||||||
- lib32z1-dev
|
|
||||||
- zlib1g-dev
|
|
||||||
- bzip2
|
|
||||||
- libc6-dbg
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_regression.sh" ARCH="64" SAN="UBSAN" MSGPACK_FUZZ_REGRESSION="ON"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-trusty-5.0
|
|
||||||
packages:
|
|
||||||
- bzip2
|
|
||||||
- clang-5.0
|
|
||||||
script:
|
|
||||||
- CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CMAKE_LIBRARY_PATH="${BASE}" GTEST_ROOT="${BASE}/gtest" BOOST_ROOT="${BASE}/boost" CTEST_OUTPUT_ON_FAILURE=1 MSGPACK_SAN="${SAN}" ci/build_regression.sh
|
|
||||||
- os: linux
|
|
||||||
compiler: clang
|
|
||||||
env: ACTION="ci/build_regression.sh" ARCH="64" SAN="ASAN" MSGPACK_FUZZ_REGRESSION="ON"
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- ubuntu-toolchain-r-test
|
|
||||||
- llvm-toolchain-trusty-5.0
|
|
||||||
packages:
|
|
||||||
- bzip2
|
|
||||||
- clang-5.0
|
|
||||||
script:
|
|
||||||
- CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CMAKE_LIBRARY_PATH="${BASE}" GTEST_ROOT="${BASE}/gtest" BOOST_ROOT="${BASE}/boost" CTEST_OUTPUT_ON_FAILURE=1 MSGPACK_SAN="${SAN}" ci/build_regression.sh
|
|
||||||
|
|
||||||
|
|
||||||
script:
|
|
||||||
- CMAKE_CXX_COMPILER="${CXX}" CMAKE_C_COMPILER="${CC}" CMAKE_LIBRARY_PATH="${BASE}/usr/lib:${BASE}/build" GTEST_ROOT="${BASE}/usr" BOOST_ROOT="${BASE}/usr" CFLAGS="-Werror -g" CXXFLAGS="-Werror -g" ${ACTION}
|
|
||||||
- cat Files.cmake| grep ".*\.[h|hpp]" | perl -pe 's/ //g' | sort > tmp1 && find include -name "*.h" -o -name "*.hpp" | sort > tmp2 && diff tmp1 tmp2
|
|
63
CHANGELOG.md
63
CHANGELOG.md
@@ -1,3 +1,66 @@
|
|||||||
|
# 2021-08-29 version 4.0.0 for C++
|
||||||
|
* Improve zone alignment logic (#965)
|
||||||
|
* Fix v1 unpack logic for STR and BIN (#957, #951)
|
||||||
|
* Fix UB on memcmp with size 0 (#954)
|
||||||
|
* Fix `iovec` name conflict (#952)
|
||||||
|
* Add `std::array<std::byte>` `std::span<char>` `std::span<unsigned char>` `std::span<std::byte>` adaptors (#951)
|
||||||
|
* Improve documents (#918, #919, #951)
|
||||||
|
* Improve tests (#916)
|
||||||
|
* Introduce BOOST_ASSERT (#898)
|
||||||
|
* Improve build system (#897, #905, #924, #951)
|
||||||
|
* Improve Boost.Fusion support (#894)
|
||||||
|
* Check nullptr before call memcpy (#891)
|
||||||
|
* Refine and bugfix `std::chrono::time_point` adaptor (#888, #893)
|
||||||
|
* Improve CI (#884, #892, #895, #951, #955)
|
||||||
|
## << breaking changes >>
|
||||||
|
* Separate C++ part of the msgpack-c from C/C++ mixed msgpack-c (#876, #878)
|
||||||
|
* Require boost libraries. See README.md Dependency(#912)
|
||||||
|
|
||||||
|
# 2020-06-05 version 3.3.0
|
||||||
|
* Add json example for C (#870)
|
||||||
|
* Add both header and body packing functions for C (#870)
|
||||||
|
* Set default ref_size and chunk_size to vrefbuffer (#865)
|
||||||
|
* Add examples (#861)
|
||||||
|
* Improve build system (#839, #842)
|
||||||
|
* Improve tests (#829)
|
||||||
|
* Improve documents (#828)
|
||||||
|
* Remove some warnings (#827, #851, #871)
|
||||||
|
* Improve CI environment (#824, #831, #833, #834, #846, #860, 874)
|
||||||
|
|
||||||
|
# 2019-12-10 version 3.2.1
|
||||||
|
* Fix snprintf return value checking (#821)
|
||||||
|
* Remove some warnings (#819)
|
||||||
|
* Fix fbuffer result checking (#812)
|
||||||
|
* Fix temporary object handling (#807)
|
||||||
|
* Improve cmake support (#804)
|
||||||
|
* Fix invalid `int main` parameter (#800)
|
||||||
|
* Improve supporting platform (#797, #817)
|
||||||
|
* Fix ZLIB error handling (#795)
|
||||||
|
* Remove unused variable (#793)
|
||||||
|
* Improve integer overflow checking (#792)
|
||||||
|
|
||||||
|
# 2019-05-27 version 3.2.0
|
||||||
|
|
||||||
|
* Fix invalid include (#783)
|
||||||
|
* Add timespec support (#781)
|
||||||
|
* Fix unchecked fnprintf on C (#780)
|
||||||
|
* Improve integer overflow checking on C (#776)
|
||||||
|
* Fix warnings on `-Wconversion` (#770, #777, #784)
|
||||||
|
* Fix invalid passed by value on aligned_zone_size_visitor (#764)
|
||||||
|
* Improve windows support (#757, #779)
|
||||||
|
* Fix msgpack::object size caluclation error (#754)
|
||||||
|
* Fix memory error on example code (#753)
|
||||||
|
* Fix redundant memory allocation on C (#747)
|
||||||
|
* Fix msgpack::type::tuple base class conversion (#743)
|
||||||
|
|
||||||
|
# 2018-09-09 version 3.1.1
|
||||||
|
|
||||||
|
* Add force endian set functionality (#736)
|
||||||
|
* Fix vrefbuffer memory management problem (#733)
|
||||||
|
* Fix msvc specific problem (#731, #732)
|
||||||
|
* Update boost from 1.61.0 to 1.68.0 (#730)
|
||||||
|
* Fix msgpack_timestamp type mismatch bug (#726)
|
||||||
|
|
||||||
# 2018-08-10 version 3.1.0
|
# 2018-08-10 version 3.1.0
|
||||||
|
|
||||||
* Improve documents (#687, #718)
|
* Improve documents (#687, #718)
|
||||||
|
461
CMakeLists.txt
461
CMakeLists.txt
@@ -1,13 +1,10 @@
|
|||||||
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12)
|
CMAKE_MINIMUM_REQUIRED (VERSION 3.1 FATAL_ERROR)
|
||||||
|
|
||||||
IF ((CMAKE_VERSION VERSION_GREATER 3.1) OR
|
CMAKE_POLICY (SET CMP0054 NEW)
|
||||||
(CMAKE_VERSION VERSION_EQUAL 3.1))
|
|
||||||
CMAKE_POLICY(SET CMP0054 NEW)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
PROJECT (msgpack)
|
PROJECT (msgpack LANGUAGES CXX)
|
||||||
|
|
||||||
FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/version_master.h contents)
|
FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/version_master.hpp contents)
|
||||||
STRING (REGEX MATCH "#define MSGPACK_VERSION_MAJOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
|
STRING (REGEX MATCH "#define MSGPACK_VERSION_MAJOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
|
||||||
SET (VERSION_MAJOR ${CMAKE_MATCH_1})
|
SET (VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||||
STRING (REGEX MATCH "#define MSGPACK_VERSION_MINOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
|
STRING (REGEX MATCH "#define MSGPACK_VERSION_MINOR *([0-9a-zA-Z_]*)" NULL_OUT ${contents})
|
||||||
@@ -16,177 +13,69 @@ STRING (REGEX MATCH "#define MSGPACK_VERSION_REVISION *([0-9a-zA-Z_]*)" NULL_OUT
|
|||||||
SET (VERSION_REVISION ${CMAKE_MATCH_1})
|
SET (VERSION_REVISION ${CMAKE_MATCH_1})
|
||||||
SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
SET (VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
||||||
|
|
||||||
SET (prefix ${CMAKE_INSTALL_PREFIX})
|
LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
|
||||||
SET (exec_prefix "\${prefix}")
|
|
||||||
SET (libdir "\${exec_prefix}/lib")
|
|
||||||
SET (includedir "\${prefix}/include")
|
|
||||||
SET (GNUCXX_STD_SUPPORT_VERSION "4.3")
|
SET (GNUCXX_STD_SUPPORT_VERSION "4.3")
|
||||||
|
|
||||||
OPTION (MSGPACK_CXX11 "Using c++11 compiler" OFF)
|
OPTION (MSGPACK_CXX11 "Using c++11 compiler" OFF)
|
||||||
OPTION (MSGPACK_32BIT "32bit compile" OFF)
|
OPTION (MSGPACK_CXX14 "Using c++14 compiler" OFF)
|
||||||
OPTION (MSGPACK_BOOST "Using boost libraries" OFF)
|
OPTION (MSGPACK_CXX17 "Using c++17 compiler" OFF)
|
||||||
|
OPTION (MSGPACK_CXX20 "Using c++20 compiler" OFF)
|
||||||
|
|
||||||
IF (APPLE)
|
OPTION (MSGPACK_32BIT "32bit compile" OFF)
|
||||||
SET(CMAKE_MACOSX_RPATH ON)
|
OPTION (MSGPACK_USE_X3_PARSE "Use Boost X3 parse" OFF)
|
||||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
OPTION (MSGPACK_BUILD_TESTS "Build tests" OFF)
|
||||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
OPTION (MSGPACK_FUZZ_REGRESSION "Enable regression testing" OFF)
|
||||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples" OFF)
|
||||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
OPTION (MSGPACK_GEN_COVERAGE "Generate coverage report" OFF)
|
||||||
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
|
||||||
IF ("${isSystemDir}" STREQUAL "-1")
|
SET (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (MSGPACK_USE_X3_PARSE)
|
IF (MSGPACK_USE_X3_PARSE)
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
IF (NOT (MSGPACK_CXX14 OR MSGPACK_CXX17 OR MSGPACK_CXX20))
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_X3_PARSE -std=c++14 ${CMAKE_CXX_FLAGS}")
|
MESSAGE (FATAL_ERROR "MSGPACK_USE_X3_PARSE requires MSGPACK_CXX14 or newer")
|
||||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
ENDIF ()
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_X3_PARSE -std=c++14 ${CMAKE_CXX_FLAGS}")
|
SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_X3_PARSE ${CMAKE_CXX_FLAGS}")
|
||||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
ENDIF ()
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_X3_PARSE ${CMAKE_CXX_FLAGS}")
|
|
||||||
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
|
IF (MSGPACK_CXX20)
|
||||||
MESSAGE ( FATAL_ERROR "MSVC doesn't support C++14.")
|
SET (CMAKE_CXX_STANDARD 20)
|
||||||
ENDIF ()
|
ELSEIF (MSGPACK_CXX17)
|
||||||
ENDIF ()
|
SET (CMAKE_CXX_STANDARD 17)
|
||||||
|
ELSEIF (MSGPACK_CXX14)
|
||||||
|
SET (CMAKE_CXX_STANDARD 14)
|
||||||
|
ELSEIF (MSGPACK_CXX11)
|
||||||
|
SET (CMAKE_CXX_STANDARD 11)
|
||||||
ELSE ()
|
ELSE ()
|
||||||
IF (MSGPACK_CXX17)
|
SET (CMAKE_CXX_STANDARD 98)
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
SET (CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")
|
|
||||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
SET (CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}")
|
|
||||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
||||||
MESSAGE ( FATAL_ERROR "MSVC doesn't support C++17.")
|
|
||||||
ENDIF ()
|
|
||||||
ELSEIF (MSGPACK_CXX11)
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
SET (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
|
|
||||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
SET (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
|
|
||||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
||||||
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)
|
|
||||||
MESSAGE ( FATAL_ERROR "MSVC doesn't support C++11.")
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
ELSE ()
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_STD_SUPPORT_VERSION}) OR
|
|
||||||
(CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL ${GNUCXX_STD_SUPPORT_VERSION}))
|
|
||||||
SET (CMAKE_CXX_FLAGS "-std=c++98 ${CMAKE_CXX_FLAGS}")
|
|
||||||
ENDIF ()
|
|
||||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
SET (CMAKE_CXX_FLAGS "-std=c++98 ${CMAKE_CXX_FLAGS}")
|
|
||||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
||||||
IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 18)
|
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_CPP03 ${CMAKE_CXX_FLAGS}")
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF (MSGPACK_32BIT)
|
IF (MSGPACK_32BIT)
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
SET (CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
|
SET (CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
|
||||||
SET (CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}")
|
SET (CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
SET (CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}")
|
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
ELSEIF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
SET (CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
|
||||||
SET (CMAKE_CXX_FLAGS "-m32 ${CMAKE_CXX_FLAGS}")
|
SET (CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
SET (CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}")
|
ENDIF ()
|
||||||
SET (CMAKE_EXE_LINKER_FLAGS "-m32 ${CMAKE_EXE_LINKER_FLAGS}")
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
OPTION (MSGPACK_BUILD_EXAMPLES "Build msgpack examples." ON)
|
SET (Boost_USE_MULTITHREADED ON)
|
||||||
|
SET (Boost_USE_STATIC_RUNTIME OFF)
|
||||||
IF (MSGPACK_BOOST)
|
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_BOOST ${CMAKE_CXX_FLAGS}")
|
|
||||||
SET (Boost_USE_MULTITHREADED ON)
|
|
||||||
SET (Boost_USE_STATIC_RUNTIME OFF)
|
|
||||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS chrono context system timer)
|
|
||||||
INCLUDE_DIRECTORIES (
|
|
||||||
${Boost_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
LINK_DIRECTORIES (
|
|
||||||
${Boost_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
IF (MSGPACK_BOOST_DIR)
|
|
||||||
INCLUDE_DIRECTORIES (
|
|
||||||
${MSGPACK_BOOST_DIR}
|
|
||||||
)
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (MSGPACK_CHAR_SIGN)
|
IF (MSGPACK_CHAR_SIGN)
|
||||||
SET (CMAKE_C_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_C_FLAGS}")
|
SET (CMAKE_CXX_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_CXX_FLAGS}")
|
||||||
SET (CMAKE_CXX_FLAGS "-f${MSGPACK_CHAR_SIGN}-char ${CMAKE_CXX_FLAGS}")
|
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF (MSGPACK_DEFAULT_API_VERSION)
|
IF (MSGPACK_DEFAULT_API_VERSION)
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=${MSGPACK_DEFAULT_API_VERSION} ${CMAKE_CXX_FLAGS}")
|
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=${MSGPACK_DEFAULT_API_VERSION} ${CMAKE_CXX_FLAGS}")
|
||||||
ELSE ()
|
ELSE ()
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=3 ${CMAKE_CXX_FLAGS}")
|
SET (CMAKE_CXX_FLAGS "-DMSGPACK_DEFAULT_API_VERSION=3 ${CMAKE_CXX_FLAGS}")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
FILE (GLOB_RECURSE PREDEF_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/predef/include/boost ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/predef/include/boost/*.h)
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
FOREACH (F ${PREDEF_FILES})
|
IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.1)
|
||||||
SET(M "Converting ${F}")
|
INCLUDE (CheckCXXSourceCompiles)
|
||||||
MESSAGE(STATUS ${M})
|
CHECK_CXX_SOURCE_COMPILES ("
|
||||||
FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/predef/include/boost/${F} CONTENT)
|
|
||||||
STRING(REPLACE "BOOST_" "MSGPACK_" CONTENT ${CONTENT})
|
|
||||||
STRING(REPLACE "boost/" "msgpack/" CONTENT ${CONTENT})
|
|
||||||
FILE (GENERATE OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/${F} CONTENT ${CONTENT})
|
|
||||||
ENDFOREACH ()
|
|
||||||
|
|
||||||
FILE (GLOB_RECURSE PREPROCESSOR_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/preprocessor/include/boost ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/preprocessor/include/boost/*.hpp)
|
|
||||||
FOREACH (F ${PREPROCESSOR_FILES})
|
|
||||||
SET(M "Converting ${F}")
|
|
||||||
MESSAGE(STATUS ${M})
|
|
||||||
FILE (READ ${CMAKE_CURRENT_SOURCE_DIR}/external/boost/preprocessor/include/boost/${F} CONTENT)
|
|
||||||
STRING(REPLACE "BOOST_" "MSGPACK_" CONTENT ${CONTENT})
|
|
||||||
STRING(REPLACE "boost/" "msgpack/" CONTENT ${CONTENT})
|
|
||||||
FILE (GENERATE OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/include/msgpack/${F} CONTENT ${CONTENT})
|
|
||||||
ENDFOREACH ()
|
|
||||||
|
|
||||||
FIND_PACKAGE (GTest)
|
|
||||||
FIND_PACKAGE (ZLIB)
|
|
||||||
FIND_PACKAGE (Threads)
|
|
||||||
IF (GTEST_FOUND AND ZLIB_FOUND AND THREADS_FOUND AND NOT "${MSGPACK_FUZZ_REGRESSION}" STREQUAL "ON")
|
|
||||||
OPTION (MSGPACK_BUILD_TESTS "Build msgpack tests." ON)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (DEFINED BUILD_SHARED_LIBS)
|
|
||||||
IF (BUILD_SHARED_LIBS)
|
|
||||||
IF (DEFINED MSGPACK_ENABLE_SHARED AND NOT MSGPACK_ENABLE_SHARED)
|
|
||||||
MESSAGE(WARNING "MSGPACK_ENABLE_SHARED is overridden to ON by BUILD_SHARED_LIBS")
|
|
||||||
ENDIF ()
|
|
||||||
SET (MSGPACK_ENABLE_SHARED ON)
|
|
||||||
IF (DEFINED MSGPACK_ENABLE_STATIC AND MSGPACK_ENABLE_STATIC)
|
|
||||||
MESSAGE(WARNING "MSGPACK_ENABLE_STATIC is overridden to OFF by BUILD_SHARED_LIBS")
|
|
||||||
ENDIF ()
|
|
||||||
SET (MSGPACK_ENABLE_STATIC OFF)
|
|
||||||
ELSE ()
|
|
||||||
IF (DEFINED MSGPACK_ENABLE_SHARED AND MSGPACK_ENABLE_SHARED)
|
|
||||||
MESSAGE(WARNING "MSGPACK_ENABLE_SHARED is overridden to OFF by BUILD_SHARED_LIBS")
|
|
||||||
ENDIF ()
|
|
||||||
SET (MSGPACK_ENABLE_SHARED OFF)
|
|
||||||
IF (DEFINED MSGPACK_ENABLE_STATIC AND NOT MSGPACK_ENABLE_STATIC)
|
|
||||||
MESSAGE(WARNING "MSGPACK_ENABLE_STATIC is overridden to ON by BUILD_SHARED_LIBS")
|
|
||||||
ENDIF ()
|
|
||||||
SET (MSGPACK_ENABLE_STATIC ON)
|
|
||||||
ENDIF ()
|
|
||||||
ELSE ()
|
|
||||||
IF (NOT DEFINED MSGPACK_ENABLE_SHARED)
|
|
||||||
SET (MSGPACK_ENABLE_SHARED ON)
|
|
||||||
ENDIF ()
|
|
||||||
IF (NOT DEFINED MSGPACK_ENABLE_STATIC)
|
|
||||||
SET (MSGPACK_ENABLE_STATIC ON)
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
OPTION (MSGPACK_ENABLE_CXX "Enable C++ interface." ON)
|
|
||||||
|
|
||||||
INCLUDE (CheckCXXSourceCompiles)
|
|
||||||
CHECK_CXX_SOURCE_COMPILES ("
|
|
||||||
#include <bits/atomicity.h>
|
#include <bits/atomicity.h>
|
||||||
int atomic_sub(int i) { return __gnu_cxx::__exchange_and_add(&i, -1) - 1; }
|
int atomic_sub(int i) { return __gnu_cxx::__exchange_and_add(&i, -1) - 1; }
|
||||||
int atomic_add(int i) { return __gnu_cxx::__exchange_and_add(&i, 1) + 1; }
|
int atomic_add(int i) { return __gnu_cxx::__exchange_and_add(&i, 1) + 1; }
|
||||||
@@ -195,196 +84,67 @@ int main(int argc, char * argv[])
|
|||||||
atomic_sub(1);
|
atomic_sub(1);
|
||||||
atomic_add(1);
|
atomic_add(1);
|
||||||
}
|
}
|
||||||
" MSGPACK_ENABLE_GCC_CXX_ATOMIC)
|
"
|
||||||
|
MSGPACK_ENABLE_GCC_CXX_ATOMIC)
|
||||||
|
ENDIF ()
|
||||||
|
ENDIF ()
|
||||||
|
|
||||||
|
FIND_PACKAGE (Boost REQUIRED)
|
||||||
|
|
||||||
INCLUDE (Files.cmake)
|
INCLUDE (Files.cmake)
|
||||||
|
|
||||||
EXECUTE_PROCESS (
|
ADD_LIBRARY (msgpackc-cxx INTERFACE)
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src/msgpack
|
|
||||||
|
TARGET_INCLUDE_DIRECTORIES (msgpackc-cxx
|
||||||
|
INTERFACE
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
)
|
)
|
||||||
|
|
||||||
CONFIGURE_FILE (
|
TARGET_LINK_LIBRARIES (msgpackc-cxx INTERFACE Boost::boost)
|
||||||
msgpack.pc.in
|
|
||||||
msgpack.pc
|
|
||||||
@ONLY
|
|
||||||
)
|
|
||||||
|
|
||||||
IF (MSGPACK_ENABLE_SHARED)
|
IF (MSGPACK_GEN_COVERAGE)
|
||||||
ADD_LIBRARY (msgpackc SHARED
|
IF (NOT MSGPACK_BUILD_TESTS)
|
||||||
${msgpackc_SOURCES}
|
MESSAGE(FATAL_ERROR "Coverage requires -DMSGPACK_BUILD_TESTS=ON")
|
||||||
${msgpackc_HEADERS}
|
ENDIF ()
|
||||||
)
|
STRING (TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_CMAKE_BUILD_TYPE)
|
||||||
|
IF (NOT "${UPPER_CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
|
||||||
SET_TARGET_PROPERTIES (msgpackc PROPERTIES SOVERSION 2 VERSION 2.0.0)
|
MESSAGE (FATAL_ERROR "Coverage requires -DCMAKE_BUILD_TYPE=Debug")
|
||||||
|
|
||||||
TARGET_INCLUDE_DIRECTORIES (msgpackc
|
|
||||||
PUBLIC
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
|
||||||
$<INSTALL_INTERFACE:include>
|
|
||||||
PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (MSGPACK_ENABLE_CXX AND ((CMAKE_VERSION VERSION_GREATER 3.0) OR (CMAKE_VERSION VERSION_EQUAL 3.0)))
|
|
||||||
ADD_LIBRARY (msgpackc-cxx INTERFACE)
|
|
||||||
|
|
||||||
TARGET_INCLUDE_DIRECTORIES (msgpackc-cxx
|
|
||||||
INTERFACE
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
|
||||||
$<INSTALL_INTERFACE:include>
|
|
||||||
)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (MSGPACK_ENABLE_STATIC)
|
|
||||||
ADD_LIBRARY (msgpackc-static STATIC
|
|
||||||
${msgpackc_SOURCES}
|
|
||||||
${msgpackc_HEADERS}
|
|
||||||
)
|
|
||||||
|
|
||||||
TARGET_INCLUDE_DIRECTORIES (msgpackc-static
|
|
||||||
PUBLIC
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
|
||||||
$<INSTALL_INTERFACE:include>
|
|
||||||
PRIVATE
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
IF (NOT MSGPACK_ENABLE_SHARED)
|
|
||||||
# Add alias for subdirectories
|
|
||||||
ADD_LIBRARY (msgpackc ALIAS msgpackc-static)
|
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
SET_TARGET_PROPERTIES (msgpackc-static PROPERTIES OUTPUT_NAME "msgpackc")
|
INCLUDE (CodeCoverage)
|
||||||
|
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS}")
|
||||||
|
|
||||||
IF (MSGPACK_ENABLE_SHARED)
|
SETUP_TARGET_FOR_COVERAGE(coverage make coverage test)
|
||||||
IF (MSVC)
|
|
||||||
SET_TARGET_PROPERTIES (msgpackc PROPERTIES IMPORT_SUFFIX "_import.lib")
|
|
||||||
ELSEIF (MINGW)
|
|
||||||
SET_TARGET_PROPERTIES (msgpackc PROPERTIES IMPORT_SUFFIX ".dll.a")
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
# enable regression testing
|
|
||||||
IF ("${MSGPACK_FUZZ_REGRESSION}" STREQUAL "ON" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_USE_BOOST ${CMAKE_CXX_FLAGS}")
|
|
||||||
SET (Boost_USE_MULTITHREADED ON)
|
|
||||||
SET (Boost_USE_STATIC_RUNTIME OFF)
|
|
||||||
|
|
||||||
enable_testing ()
|
|
||||||
ADD_SUBDIRECTORY (fuzz)
|
|
||||||
SET (MSGPACK_BUILD_EXAMPLES OFF)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
|
|
||||||
IF (MSGPACK_BUILD_TESTS)
|
IF (MSGPACK_BUILD_TESTS)
|
||||||
ENABLE_TESTING ()
|
ENABLE_TESTING ()
|
||||||
# MEMORYCHECK_COMMAND_OPTIONS needs to place prior to CTEST_MEMORYCHECK_COMMAND
|
# MEMORYCHECK_COMMAND_OPTIONS needs to place prior to CTEST_MEMORYCHECK_COMMAND
|
||||||
SET (MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=definite,possible --error-exitcode=1")
|
SET (MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=definite,possible --error-exitcode=1")
|
||||||
FIND_PROGRAM(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
|
FIND_PROGRAM (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
|
||||||
INCLUDE(Dart)
|
INCLUDE (Dart)
|
||||||
ADD_SUBDIRECTORY (test)
|
ADD_SUBDIRECTORY (test)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
# enable regression testing
|
||||||
IF (MSGPACK_ENABLE_SHARED)
|
IF (MSGPACK_FUZZ_REGRESSION)
|
||||||
SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra -DPIC")
|
ENABLE_TESTING ()
|
||||||
ENDIF ()
|
ADD_SUBDIRECTORY (fuzz)
|
||||||
IF (MSGPACK_ENABLE_STATIC)
|
|
||||||
SET_PROPERTY (TARGET msgpackc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra" )
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
IF (MSGPACK_ENABLE_SHARED)
|
|
||||||
SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
|
||||||
ENDIF ()
|
|
||||||
IF (MSGPACK_ENABLE_STATIC)
|
|
||||||
SET_PROPERTY (TARGET msgpackc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
||||||
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
|
||||||
STRING(REGEX REPLACE "/W[0-4]" "/W3 /WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
||||||
ELSE ()
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /WX")
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC90" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC10")
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${msgpackc_SOURCES} PROPERTIES LANGUAGE CXX)
|
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "sparc")
|
IF ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "sparc")
|
||||||
SET (CMAKE_C_FLAGS "-DMSGPACK_ZONE_ALIGN=8 ${CMAKE_C_FLAGS}")
|
|
||||||
SET (CMAKE_CXX_FLAGS "-DMSGPACK_ZONE_ALIGN=8 ${CMAKE_CXX_FLAGS}")
|
SET (CMAKE_CXX_FLAGS "-DMSGPACK_ZONE_ALIGN=8 ${CMAKE_CXX_FLAGS}")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF (NOT DEFINED CMAKE_INSTALL_BINDIR)
|
|
||||||
SET(CMAKE_INSTALL_BINDIR bin)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
|
||||||
SET(CMAKE_INSTALL_LIBDIR lib)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (MSGPACK_BUILD_EXAMPLES)
|
IF (MSGPACK_BUILD_EXAMPLES)
|
||||||
ADD_SUBDIRECTORY (example)
|
ADD_SUBDIRECTORY (example)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF (MSGPACK_ENABLE_SHARED)
|
|
||||||
SET (MSGPACK_INSTALLTARGETS msgpackc)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (MSGPACK_ENABLE_CXX AND ((CMAKE_VERSION VERSION_GREATER 3.0) OR (CMAKE_VERSION VERSION_EQUAL 3.0)))
|
|
||||||
LIST (APPEND MSGPACK_INSTALLTARGETS msgpackc-cxx)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (MSGPACK_ENABLE_STATIC)
|
|
||||||
LIST (APPEND MSGPACK_INSTALLTARGETS msgpackc-static)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
INSTALL (TARGETS ${MSGPACK_INSTALLTARGETS} EXPORT msgpack-targets
|
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
||||||
)
|
|
||||||
FOREACH (file ${msgpackc_HEADERS})
|
|
||||||
GET_FILENAME_COMPONENT (dir ${file} PATH)
|
|
||||||
INSTALL (FILES ${file} DESTINATION ${CMAKE_INSTALL_PREFIX}/${dir})
|
|
||||||
ENDFOREACH ()
|
|
||||||
IF (NOT MSVC)
|
|
||||||
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/msgpack.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
# Doxygen
|
# Doxygen
|
||||||
FIND_PACKAGE (Doxygen)
|
FIND_PACKAGE (Doxygen)
|
||||||
IF (DOXYGEN_FOUND)
|
IF (DOXYGEN_FOUND)
|
||||||
LIST (APPEND Doxyfile_c_CONTENT
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "FILE_PATTERNS = *.h" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "OUTPUT_DIRECTORY = doc_c" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "INPUT = ${CMAKE_CURRENT_SOURCE_DIR}/include" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "EXTRACT_ALL = YES" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "PROJECT_NAME = \"MessagePack for C\"" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "STRIP_FROM_PATH = ${CMAKE_CURRENT_SOURCE_DIR}/include" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
|
|
||||||
)
|
|
||||||
IF (DOXYGEN_DOT_FOUND)
|
|
||||||
LIST (APPEND Doxyfile_c_CONTENT
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "HAVE_DOT = YES" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
|
|
||||||
)
|
|
||||||
ENDIF ()
|
|
||||||
ADD_CUSTOM_TARGET (
|
|
||||||
doxygen_c
|
|
||||||
${Doxyfile_c_CONTENT}
|
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_c
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
LIST (APPEND Doxyfile_cpp_CONTENT
|
LIST (APPEND Doxyfile_cpp_CONTENT
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "FILE_PATTERNS = *.hpp" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
|
COMMAND ${CMAKE_COMMAND} -E echo "FILE_PATTERNS = *.hpp" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
|
||||||
@@ -399,50 +159,63 @@ IF (DOXYGEN_FOUND)
|
|||||||
)
|
)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
ADD_CUSTOM_TARGET (
|
ADD_CUSTOM_TARGET (
|
||||||
doxygen_cpp
|
doxygen
|
||||||
${Doxyfile_cpp_CONTENT}
|
${Doxyfile_cpp_CONTENT}
|
||||||
COMMAND ${CMAKE_COMMAND} -E echo "PROJECT_NAME = \"MessagePack for C++\"" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
|
COMMAND ${CMAKE_COMMAND} -E echo "PROJECT_NAME = \"MessagePack for C++\"" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
|
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile_cpp
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
ADD_CUSTOM_TARGET (
|
|
||||||
doxygen
|
|
||||||
DEPENDS doxygen_c doxygen_cpp
|
|
||||||
)
|
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
|
# Install library.
|
||||||
|
INSTALL (TARGETS msgpackc-cxx
|
||||||
|
EXPORT msgpackc-cxx-targets
|
||||||
|
COMPONENT msgpackc-cxx
|
||||||
|
# This provides include directory in exported target
|
||||||
|
# relative to prefix in single directory we've put everything in.
|
||||||
|
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Install headers from source tree.
|
||||||
|
INSTALL (DIRECTORY include/
|
||||||
|
DESTINATION include
|
||||||
|
COMPONENT msgpackc-cxx
|
||||||
|
)
|
||||||
|
|
||||||
INCLUDE (CMakePackageConfigHelpers)
|
INCLUDE (CMakePackageConfigHelpers)
|
||||||
|
|
||||||
SET (CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/msgpack")
|
IF (NOT (CMAKE_VERSION VERSION_LESS 3.14))
|
||||||
|
SET (extra_version_file_args ARCH_INDEPENDENT)
|
||||||
|
ENDIF ()
|
||||||
|
SET (cmake_config_path "lib/cmake/msgpackc-cxx")
|
||||||
|
|
||||||
|
# Configure the main package file from source tree.
|
||||||
|
CONFIGURE_PACKAGE_CONFIG_FILE (
|
||||||
|
msgpack-config.cmake.in
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config.cmake"
|
||||||
|
INSTALL_DESTINATION "${cmake_config_path}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Write package version file.
|
||||||
WRITE_BASIC_PACKAGE_VERSION_FILE (
|
WRITE_BASIC_PACKAGE_VERSION_FILE (
|
||||||
msgpack-config-version.cmake
|
msgpack-config-version.cmake
|
||||||
VERSION ${VERSION}
|
VERSION ${VERSION}
|
||||||
COMPATIBILITY SameMajorVersion
|
COMPATIBILITY SameMajorVersion
|
||||||
|
${extra_version_file_args}
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (NOT CMAKE_VERSION VERSION_LESS 3.0)
|
# Install the generated package version file and the main package file.
|
||||||
EXPORT (EXPORT msgpack-targets
|
INSTALL (FILES
|
||||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/msgpack-targets.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config.cmake"
|
||||||
)
|
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config-version.cmake"
|
||||||
ENDIF ()
|
DESTINATION "${cmake_config_path}"
|
||||||
|
COMPONENT msgpackc-cxx
|
||||||
CONFIGURE_PACKAGE_CONFIG_FILE (msgpack-config.cmake.in
|
|
||||||
msgpack-config.cmake
|
|
||||||
INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}"
|
|
||||||
)
|
|
||||||
|
|
||||||
INSTALL (EXPORT msgpack-targets
|
|
||||||
FILE
|
|
||||||
msgpack-targets.cmake
|
|
||||||
DESTINATION
|
|
||||||
"${CMAKE_INSTALL_CMAKEDIR}"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# This installs package in install tree for using installed targets.
|
||||||
INSTALL (
|
INSTALL (
|
||||||
FILES
|
EXPORT msgpackc-cxx-targets
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config.cmake"
|
FILE msgpackc-cxx-targets.cmake
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/msgpack-config-version.cmake"
|
DESTINATION "${cmake_config_path}"
|
||||||
DESTINATION
|
COMPONENT msgpackc-cxx
|
||||||
"${CMAKE_INSTALL_CMAKEDIR}"
|
|
||||||
)
|
)
|
||||||
|
1055
Files.cmake
1055
Files.cmake
File diff suppressed because it is too large
Load Diff
194
QUICKSTART-C.md
194
QUICKSTART-C.md
@@ -1,194 +0,0 @@
|
|||||||
# Implementation Status
|
|
||||||
|
|
||||||
The serialization library is production-ready.
|
|
||||||
|
|
||||||
Currently, RPC implementation is not available.
|
|
||||||
|
|
||||||
# Install
|
|
||||||
|
|
||||||
|
|
||||||
## Mac OS X with MacPorts
|
|
||||||
|
|
||||||
On Mac OS X, you can install MessagePack for C using MacPorts.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ sudo port install msgpack
|
|
||||||
```
|
|
||||||
|
|
||||||
You might need to run `sudo port selfupdate` before installing to update the package repository.
|
|
||||||
|
|
||||||
You can also install via Homebrew.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ brew install msgpack
|
|
||||||
```
|
|
||||||
|
|
||||||
## FreeBSD with Ports Collection
|
|
||||||
|
|
||||||
On FreeBSD, you can use Ports Collection. Install [net/msgpack|http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/msgpack/] package.
|
|
||||||
|
|
||||||
## Gentoo Linux with Portage
|
|
||||||
|
|
||||||
On Gentoo Linux, you can use emerge. Install [dev-libs/msgpack|http://gentoo-portage.com/dev-libs/msgpack] package.
|
|
||||||
|
|
||||||
## Other UNIX-like platform with ./configure
|
|
||||||
|
|
||||||
On the other UNIX-like platforms, download source package from [Releases|http://msgpack.org/releases/cpp/] and run `./configure && make && make install`.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ wget http://msgpack.org/releases/cpp/msgpack-1.3.0.tar.gz
|
|
||||||
$ tar zxvf msgpack-1.3.0.tar.gz
|
|
||||||
$ cd msgpack-1.3.0
|
|
||||||
$ ./configure
|
|
||||||
$ make
|
|
||||||
$ sudo make install
|
|
||||||
```
|
|
||||||
|
|
||||||
## Windows
|
|
||||||
|
|
||||||
On Windows, download source package from [here|https://sourceforge.net/projects/msgpack/files/] and extract it.
|
|
||||||
Then open `msgpack_vc8.vcproj` file and build it using batch build. It builds libraries on `lib/` folder and header files on `include/` folder.
|
|
||||||
|
|
||||||
You can build using command line as follows:
|
|
||||||
|
|
||||||
```
|
|
||||||
> vcbuild msgpack_vc2008.vcproj
|
|
||||||
> dir lib % DLL files are here
|
|
||||||
> dir include % header files are here
|
|
||||||
```
|
|
||||||
|
|
||||||
## Install from git repository
|
|
||||||
|
|
||||||
You need to install gcc (4.1.0 or higher), autotools.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ git clone git@github.com:msgpack/msgpack.git
|
|
||||||
$ cd msgpack/cpp
|
|
||||||
$ ./bootstrap
|
|
||||||
$ ./configure
|
|
||||||
$ make
|
|
||||||
$ sudo make install
|
|
||||||
```
|
|
||||||
|
|
||||||
# Serialization QuickStart for C
|
|
||||||
|
|
||||||
## First program
|
|
||||||
|
|
||||||
Include `msgpack.h` header and link `msgpack` library to use MessagePack on your program.
|
|
||||||
|
|
||||||
```c
|
|
||||||
#include <msgpack.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
|
|
||||||
/* creates buffer and serializer instance. */
|
|
||||||
msgpack_sbuffer* buffer = msgpack_sbuffer_new();
|
|
||||||
msgpack_packer* pk = msgpack_packer_new(buffer, msgpack_sbuffer_write);
|
|
||||||
|
|
||||||
/* serializes ["Hello", "MessagePack"]. */
|
|
||||||
msgpack_pack_array(pk, 2);
|
|
||||||
msgpack_pack_bin(pk, 5);
|
|
||||||
msgpack_pack_bin_body(pk, "Hello", 5);
|
|
||||||
msgpack_pack_bin(pk, 11);
|
|
||||||
msgpack_pack_bin_body(pk, "MessagePack", 11);
|
|
||||||
|
|
||||||
/* deserializes it. */
|
|
||||||
msgpack_unpacked msg;
|
|
||||||
msgpack_unpacked_init(&msg);
|
|
||||||
msgpack_unpack_return ret = msgpack_unpack_next(&msg, buffer->data, buffer->size, NULL);
|
|
||||||
|
|
||||||
/* prints the deserialized object. */
|
|
||||||
msgpack_object obj = msg.data;
|
|
||||||
msgpack_object_print(stdout, obj); /*=> ["Hello", "MessagePack"] */
|
|
||||||
|
|
||||||
/* cleaning */
|
|
||||||
msgpack_sbuffer_free(buffer);
|
|
||||||
msgpack_packer_free(pk);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Simple program with a loop
|
|
||||||
|
|
||||||
```c
|
|
||||||
#include <msgpack.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
|
|
||||||
/* creates buffer and serializer instance. */
|
|
||||||
msgpack_sbuffer* buffer = msgpack_sbuffer_new();
|
|
||||||
msgpack_packer* pk = msgpack_packer_new(buffer, msgpack_sbuffer_write);
|
|
||||||
|
|
||||||
int j;
|
|
||||||
|
|
||||||
for(j = 0; j<23; j++) {
|
|
||||||
/* NB: the buffer needs to be cleared on each iteration */
|
|
||||||
msgpack_sbuffer_clear(buffer);
|
|
||||||
|
|
||||||
/* serializes ["Hello", "MessagePack"]. */
|
|
||||||
msgpack_pack_array(pk, 3);
|
|
||||||
msgpack_pack_bin(pk, 5);
|
|
||||||
msgpack_pack_bin_body(pk, "Hello", 5);
|
|
||||||
msgpack_pack_bin(pk, 11);
|
|
||||||
msgpack_pack_bin_body(pk, "MessagePack", 11);
|
|
||||||
msgpack_pack_int(pk, j);
|
|
||||||
|
|
||||||
/* deserializes it. */
|
|
||||||
msgpack_unpacked msg;
|
|
||||||
msgpack_unpacked_init(&msg);
|
|
||||||
msgpack_unpack_return ret = msgpack_unpack_next(&msg, buffer->data, buffer->size, NULL);
|
|
||||||
|
|
||||||
/* prints the deserialized object. */
|
|
||||||
msgpack_object obj = msg.data;
|
|
||||||
msgpack_object_print(stdout, obj); /*=> ["Hello", "MessagePack"] */
|
|
||||||
puts("");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* cleaning */
|
|
||||||
msgpack_sbuffer_free(buffer);
|
|
||||||
msgpack_packer_free(pk);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Streaming feature
|
|
||||||
|
|
||||||
```c
|
|
||||||
#include <msgpack.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
/* serializes multiple objects using msgpack_packer. */
|
|
||||||
msgpack_sbuffer* buffer = msgpack_sbuffer_new();
|
|
||||||
msgpack_packer* pk = msgpack_packer_new(buffer, msgpack_sbuffer_write);
|
|
||||||
msgpack_pack_int(pk, 1);
|
|
||||||
msgpack_pack_int(pk, 2);
|
|
||||||
msgpack_pack_int(pk, 3);
|
|
||||||
|
|
||||||
/* deserializes these objects using msgpack_unpacker. */
|
|
||||||
msgpack_unpacker pac;
|
|
||||||
msgpack_unpacker_init(&pac, MSGPACK_UNPACKER_INIT_BUFFER_SIZE);
|
|
||||||
|
|
||||||
/* feeds the buffer. */
|
|
||||||
msgpack_unpacker_reserve_buffer(&pac, buffer->size);
|
|
||||||
memcpy(msgpack_unpacker_buffer(&pac), buffer->data, buffer->size);
|
|
||||||
msgpack_unpacker_buffer_consumed(&pac, buffer->size);
|
|
||||||
|
|
||||||
/* now starts streaming deserialization. */
|
|
||||||
msgpack_unpacked result;
|
|
||||||
msgpack_unpacked_init(&result);
|
|
||||||
|
|
||||||
while(msgpack_unpacker_next(&pac, &result)) {
|
|
||||||
msgpack_object_print(stdout, result.data);
|
|
||||||
puts("");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* results:
|
|
||||||
* $ gcc stream.cc -lmsgpackc -o stream
|
|
||||||
* $ ./stream
|
|
||||||
* 1
|
|
||||||
* 2
|
|
||||||
* 3
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
```
|
|
@@ -59,7 +59,7 @@ $ ./hello
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
int main(void) {
|
int main() {
|
||||||
// serializes multiple objects using msgpack::packer.
|
// serializes multiple objects using msgpack::packer.
|
||||||
msgpack::sbuffer buffer;
|
msgpack::sbuffer buffer;
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ int main(void) {
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
int main(void) {
|
int main() {
|
||||||
// serializes multiple objects into one message containing an array using msgpack::packer.
|
// serializes multiple objects into one message containing an array using msgpack::packer.
|
||||||
msgpack::sbuffer buffer;
|
msgpack::sbuffer buffer;
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ public:
|
|||||||
MSGPACK_DEFINE(m_str, m_vec);
|
MSGPACK_DEFINE(m_str, m_vec);
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(void) {
|
int main() {
|
||||||
std::vector<myclass> vec;
|
std::vector<myclass> vec;
|
||||||
// add some elements into vec...
|
// add some elements into vec...
|
||||||
|
|
||||||
|
178
README.md
178
README.md
@@ -1,7 +1,8 @@
|
|||||||
`msgpack` for C/C++
|
`msgpack` for C++
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Version 3.1.0 [](https://travis-ci.org/msgpack/msgpack-c) [](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/master)
|
Version 4.0.0 [](https://github.com/msgpack/msgpack-c/actions) [](https://ci.appveyor.com/project/redboltz/msgpack-c/branch/cpp_master)
|
||||||
|
[](https://codecov.io/gh/msgpack/msgpack-c/branch/cpp_master)
|
||||||
|
|
||||||
It's like JSON but smaller and faster.
|
It's like JSON but smaller and faster.
|
||||||
|
|
||||||
@@ -17,58 +18,13 @@ addition to the strings themselves.
|
|||||||
Example
|
Example
|
||||||
-------
|
-------
|
||||||
|
|
||||||
In C:
|
|
||||||
|
|
||||||
```c
|
|
||||||
#include <msgpack.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
/* msgpack::sbuffer is a simple buffer implementation. */
|
|
||||||
msgpack_sbuffer sbuf;
|
|
||||||
msgpack_sbuffer_init(&sbuf);
|
|
||||||
|
|
||||||
/* serialize values into the buffer using msgpack_sbuffer_write callback function. */
|
|
||||||
msgpack_packer pk;
|
|
||||||
msgpack_packer_init(&pk, &sbuf, msgpack_sbuffer_write);
|
|
||||||
|
|
||||||
msgpack_pack_array(&pk, 3);
|
|
||||||
msgpack_pack_int(&pk, 1);
|
|
||||||
msgpack_pack_true(&pk);
|
|
||||||
msgpack_pack_str(&pk, 7);
|
|
||||||
msgpack_pack_str_body(&pk, "example", 7);
|
|
||||||
|
|
||||||
/* deserialize the buffer into msgpack_object instance. */
|
|
||||||
/* deserialized object is valid during the msgpack_zone instance alive. */
|
|
||||||
msgpack_zone mempool;
|
|
||||||
msgpack_zone_init(&mempool, 2048);
|
|
||||||
|
|
||||||
msgpack_object deserialized;
|
|
||||||
msgpack_unpack(sbuf.data, sbuf.size, NULL, &mempool, &deserialized);
|
|
||||||
|
|
||||||
/* print the deserialized object. */
|
|
||||||
msgpack_object_print(stdout, deserialized);
|
|
||||||
puts("");
|
|
||||||
|
|
||||||
msgpack_zone_destroy(&mempool);
|
|
||||||
msgpack_sbuffer_destroy(&sbuf);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
See [`QUICKSTART-C.md`](./QUICKSTART-C.md) for more details.
|
|
||||||
|
|
||||||
In C++:
|
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
#include <msgpack.hpp>
|
#include <msgpack.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
int main(void)
|
int main()
|
||||||
{
|
{
|
||||||
msgpack::type::tuple<int, bool, std::string> src(1, true, "example");
|
msgpack::type::tuple<int, bool, std::string> src(1, true, "example");
|
||||||
|
|
||||||
@@ -107,76 +63,126 @@ int main(void)
|
|||||||
|
|
||||||
See [`QUICKSTART-CPP.md`](./QUICKSTART-CPP.md) for more details.
|
See [`QUICKSTART-CPP.md`](./QUICKSTART-CPP.md) for more details.
|
||||||
|
|
||||||
|
Dependency
|
||||||
|
----------
|
||||||
|
|
||||||
|
msgpack-c requires [boost library](https://www.boost.org/).
|
||||||
|
C++ version of msgpack-c itself is a header-only library and depends only on
|
||||||
|
boost headers. Tests depend on boost unit test framework and are linked with
|
||||||
|
it, so if you want to build them, you need to have this dependency installed.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
||||||
### C++ Header Only Library
|
- If you build your project with cmake, you can find msgpack-c with a
|
||||||
|
canonical cmake-way:
|
||||||
|
|
||||||
When you use msgpack on C++, you can just add
|
```cmake
|
||||||
msgpack-c/include to your include path:
|
# ...
|
||||||
|
find_package(msgpack REQUIRED)
|
||||||
|
# ...
|
||||||
|
target_link_libraries(your_target_name <PRIVATE/PUBLIC/INTERFACE> msgpackc-cxx)
|
||||||
|
# ...
|
||||||
|
```
|
||||||
|
|
||||||
g++ -I msgpack-c/include your_source_file.cpp
|
This will search for `msgpack` cmake package in a system prefix and in
|
||||||
|
prefixes from `CMAKE_PREFIX_PATH`. Note that msgpack-c depends on boost
|
||||||
|
headers, and `msgpack` cmake package depends on `Boost` cmake package. The
|
||||||
|
library is header-only and `target_link_libraries` command just adds path
|
||||||
|
to msgpack-c headers to your compiler's include path.
|
||||||
|
|
||||||
If you want to use C version of msgpack, you need to build it. You can
|
A usage example can be found at [test-install](test-install) directory.
|
||||||
also install the C and C++ versions of msgpack.
|
|
||||||
|
|
||||||
### Building and Installing
|
- If you do not use cmake, you can just add path yo msgpack-c and boost
|
||||||
|
headers to your include path:
|
||||||
|
|
||||||
#### Install from git repository
|
```bash
|
||||||
|
g++ -I msgpack-c/include -I path_to_boost your_source_file.cpp
|
||||||
|
```
|
||||||
|
|
||||||
##### Using the Terminal (CLI)
|
Building and Installing
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
### Install from git repository
|
||||||
|
|
||||||
|
#### Using the Terminal (CLI)
|
||||||
|
|
||||||
You will need:
|
You will need:
|
||||||
|
|
||||||
- `gcc >= 4.1.0`
|
- `gcc >= 4.1.0`
|
||||||
- `cmake >= 2.8.0`
|
- `cmake >= 3.1.0`
|
||||||
|
|
||||||
C and C++03:
|
C++03:
|
||||||
|
|
||||||
$ git clone https://github.com/msgpack/msgpack-c.git
|
```bash
|
||||||
$ cd msgpack-c
|
git clone https://github.com/msgpack/msgpack-c.git
|
||||||
$ cmake .
|
cd msgpack-c
|
||||||
$ make
|
git checkout cpp_master
|
||||||
$ sudo make install
|
cmake .
|
||||||
|
sudo cmake --build . --target install
|
||||||
|
```
|
||||||
|
|
||||||
If you want to setup C++11 or C++17 version of msgpack instead,
|
If you want to build tests with different C++ version, you can use
|
||||||
execute the following commands:
|
`MSGPACK_CXX11`, `MSGPACK_CXX14`, `MSGPACK_CXX17`, `MSGPACK_CXX20` options.
|
||||||
|
Just replace the line
|
||||||
|
|
||||||
$ git clone https://github.com/msgpack/msgpack-c.git
|
```bash
|
||||||
$ cd msgpack-c
|
cmake .
|
||||||
$ cmake -DMSGPACK_CXX[11|17]=ON .
|
```
|
||||||
$ sudo make install
|
|
||||||
|
|
||||||
`MSGPACK_CXX[11|17]` flags are not affected to installing files. Just switching test cases. All files are installed in every settings.
|
with a line like that:
|
||||||
|
|
||||||
When you use the C part of `msgpack-c`, you need to build and link the library. By default, both static/shared libraries are built. If you want to build only static library, set `BUILD_SHARED_LIBS=OFF` to cmake. If you want to build only shared library, set `BUILD_SHARED_L
|
```bash
|
||||||
|
cmake -DMSGPACK_CXX20=ON .
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that these flags do not affect installation. They just switch test cases.
|
||||||
|
All files are installed in every settings.
|
||||||
|
|
||||||
|
If you don't have superuser permissions or don't want to install the library
|
||||||
|
to a system-wide prefix, you can use `CMAKE_INSTALL_PREFIX` option like that:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cmake -DCMAKE_INSTALL_PREFIX=/your/custom/prefix .
|
||||||
|
```
|
||||||
|
|
||||||
|
Other useful options:
|
||||||
|
|
||||||
|
- `MSGPACK_BUILD_TESTS` (default `OFF`): build tests
|
||||||
|
- `MSGPACK_BUILD_EXAMPLES` (default `OFF`): build examples
|
||||||
|
- `MSGPACK_32BIT` (default `OFF`): 32bit compile
|
||||||
|
- `MSGPACK_USE_X3_PARSE` (default `OFF`): use Boost X3 parse
|
||||||
|
(note that it requires C++14 or newer)
|
||||||
|
|
||||||
#### GUI on Windows
|
#### GUI on Windows
|
||||||
|
|
||||||
Clone msgpack-c git repository.
|
Clone msgpack-c git repository with the command:
|
||||||
|
|
||||||
$ git clone https://github.com/msgpack/msgpack-c.git
|
```
|
||||||
|
git clone https://github.com/msgpack/msgpack-c.git
|
||||||
|
```
|
||||||
|
|
||||||
or using GUI git client.
|
or using GUI git client (e.g. [tortoise git](https://code.google.com/p/tortoisegit/)).
|
||||||
|
|
||||||
e.g.) tortoise git https://code.google.com/p/tortoisegit/
|
1. Checkout to `cpp_master` branch
|
||||||
|
|
||||||
1. Launch [cmake GUI client](http://www.cmake.org/cmake/resources/software.html).
|
2. Launch [cmake GUI client](http://www.cmake.org/cmake/resources/software.html).
|
||||||
|
|
||||||
2. Set 'Where is the source code:' text box and 'Where to build
|
3. Set 'Where is the source code:' text box and
|
||||||
the binaries:' text box.
|
'Where to build the binaries:' text box.
|
||||||
|
|
||||||
3. Click 'Configure' button.
|
4. Click 'Configure' button.
|
||||||
|
|
||||||
4. Choose your Visual Studio version.
|
5. Choose your Visual Studio version.
|
||||||
|
|
||||||
5. Click 'Generate' button.
|
6. Click 'Generate' button.
|
||||||
|
|
||||||
6. Open the created msgpack.sln on Visual Studio.
|
7. Open the created msgpack.sln on Visual Studio.
|
||||||
|
|
||||||
7. Build all.
|
8. Build all.
|
||||||
|
|
||||||
### Documentation
|
Documentation
|
||||||
|
-------------
|
||||||
|
|
||||||
You can get additional information including the tutorial on the
|
You can get additional information including the tutorial on the
|
||||||
[wiki](https://github.com/msgpack/msgpack-c/wiki).
|
[wiki](https://github.com/msgpack/msgpack-c/wiki).
|
||||||
|
106
appveyor.yml
106
appveyor.yml
@@ -1,58 +1,66 @@
|
|||||||
version: 3.1.0.{build}
|
version: 4.0.0.{build}
|
||||||
|
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- cpp_master
|
||||||
|
|
||||||
image:
|
|
||||||
- Visual Studio 2015
|
|
||||||
environment:
|
environment:
|
||||||
global:
|
|
||||||
BOOST_ROOT: C:\Libraries\boost_1_60_0
|
|
||||||
matrix:
|
matrix:
|
||||||
- cpp11: -DMSGPACK_CXX11=OFF
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
|
||||||
boost: -DMSGPACK_BOOST=OFF
|
cpp11: -DMSGPACK_CXX11=OFF
|
||||||
msvc: '"Visual Studio 10 2010"'
|
|
||||||
- cpp11: -DMSGPACK_CXX11=OFF
|
|
||||||
boost: -DMSGPACK_BOOST=OFF
|
|
||||||
msvc: '"Visual Studio 11 2012"'
|
|
||||||
- cpp11: -DMSGPACK_CXX11=OFF
|
|
||||||
boost: -DMSGPACK_BOOST=OFF
|
|
||||||
msvc: '"Visual Studio 12 2013"'
|
msvc: '"Visual Studio 12 2013"'
|
||||||
- cpp11: -DMSGPACK_CXX11=ON
|
boost_prefix: C:\Libraries\boost_1_58_0
|
||||||
boost: -DMSGPACK_BOOST=ON
|
boost_subdir: lib32-msvc-12.0
|
||||||
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
|
cpp11: -DMSGPACK_CXX11=OFF
|
||||||
msvc: '"Visual Studio 14 2015"'
|
msvc: '"Visual Studio 14 2015"'
|
||||||
- cpp11: -DMSGPACK_CXX11=OFF
|
boost_prefix: C:\Libraries\boost_1_69_0
|
||||||
boost: -DMSGPACK_BOOST=ON
|
boost_subdir: lib32-msvc-14.0
|
||||||
msvc: '"Visual Studio 14 2015"'
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- cpp11: -DMSGPACK_CXX11=ON
|
cpp11: -DMSGPACK_CXX11=ON
|
||||||
boost: -DMSGPACK_BOOST=OFF
|
|
||||||
msvc: '"Visual Studio 14 2015"'
|
|
||||||
- cpp11: -DMSGPACK_CXX11=OFF
|
|
||||||
boost: -DMSGPACK_BOOST=OFF
|
|
||||||
msvc: '"Visual Studio 14 2015"'
|
msvc: '"Visual Studio 14 2015"'
|
||||||
|
boost_prefix: C:\Libraries\boost_1_69_0
|
||||||
|
boost_subdir: lib32-msvc-14.0
|
||||||
build_script:
|
build_script:
|
||||||
- appveyor DownloadFile https://github.com/google/googletest/archive/release-1.7.0.zip -FileName googletest-release-1.7.0.zip
|
- ps: |
|
||||||
- 7z x googletest-release-1.7.0.zip > NUL
|
appveyor DownloadFile http://zlib.net/zlib-1.2.11.tar.gz -FileName zlib-1.2.11.tar.gz
|
||||||
- cd googletest-release-1.7.0
|
7z x zlib-1.2.11.tar.gz 2> $null
|
||||||
- md build
|
7z x zlib-1.2.11.tar 2> $null
|
||||||
- cd build
|
cd zlib-1.2.11
|
||||||
- cmake -G %msvc% -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS=/D_VARIADIC_MAX=10 ..
|
|
||||||
- cmake --build . --config Release
|
md build
|
||||||
- cd ..
|
md prefix
|
||||||
- cd ..
|
cd build
|
||||||
- appveyor DownloadFile http://zlib.net/zlib-1.2.11.tar.gz -FileName zlib-1.2.11.tar.gz
|
|
||||||
- 7z x zlib-1.2.11.tar.gz > NUL
|
cmake `
|
||||||
- 7z x zlib-1.2.11.tar > NUL
|
-G $env:msvc `
|
||||||
- cd zlib-1.2.11
|
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.11\prefix" `
|
||||||
- md build
|
..
|
||||||
- cd build
|
if ($LastExitCode -ne 0) { exit $LastExitCode }
|
||||||
- cmake -G %msvc% ..
|
|
||||||
- cmake --build . --config Release
|
cmake --build . --target install --config Release
|
||||||
- copy zconf.h ..
|
if ($LastExitCode -ne 0) { exit $LastExitCode }
|
||||||
- cd ..
|
cd ..\..
|
||||||
- cd ..
|
|
||||||
- md build
|
md build
|
||||||
- cd build
|
md prefix
|
||||||
- cmake -G %msvc% %cpp11% %boost% %x3_parse% -DGTEST_LIBRARY=%APPVEYOR_BUILD_FOLDER%\googletest-release-1.7.0\build\Release\gtest.lib -DGTEST_MAIN_LIBRARY=%APPVEYOR_BUILD_FOLDER%\googletest-release-1.7.0\build\Release\gtest_main.lib -DGTEST_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%\googletest-release-1.7.0\include -DZLIB_LIBRARY=%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\build\Release\zlib.lib -DZLIB_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11 -DCMAKE_CXX_FLAGS='"/D_VARIADIC_MAX=10 /EHsc"' ..
|
cd build
|
||||||
- cmake --build . --config Release
|
|
||||||
|
cmake `
|
||||||
|
-G $env:msvc `
|
||||||
|
$env:cpp11 `
|
||||||
|
-D MSGPACK_BUILD_EXAMPLES=ON `
|
||||||
|
-D MSGPACK_BUILD_TESTS=ON `
|
||||||
|
-D CMAKE_EXE_LINKER_FLAGS=/LIBPATH:"$env:boost_prefix\$env:boost_subdir" `
|
||||||
|
-D CMAKE_PREFIX_PATH="$env:boost_prefix;$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.11\prefix" `
|
||||||
|
-D CMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER\prefix" `
|
||||||
|
-D CMAKE_CXX_FLAGS="/D_VARIADIC_MAX=10 /EHsc /DBOOST_ALL_DYN_LINK" `
|
||||||
|
..
|
||||||
|
if ($LastExitCode -ne 0) { exit $LastExitCode }
|
||||||
|
|
||||||
|
cmake --build . --config Release
|
||||||
|
if ($LastExitCode -ne 0) { exit $LastExitCode }
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\googletest-release-1.7.0\build\Release;%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release
|
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release;%boost_prefix%\%boost_subdir%
|
||||||
- ctest -V
|
- ctest -VV -C Release
|
||||||
|
@@ -1,63 +1,37 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
mkdir build
|
build_dir="$CXX-build"
|
||||||
|
prefix_dir="`pwd`/$CXX-prefix"
|
||||||
|
mkdir $build_dir || exit 1
|
||||||
|
mkdir $prefix_dir || exit 1
|
||||||
|
|
||||||
ret=$?
|
if [ "${ARCH}" == "32" ]; then
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd build
|
|
||||||
|
|
||||||
ret=$?
|
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}" == "32" ]
|
|
||||||
then
|
|
||||||
export BIT32="ON"
|
export BIT32="ON"
|
||||||
|
export ARCH_FLAG="-m32"
|
||||||
else
|
else
|
||||||
export BIT32="OFF"
|
export BIT32="OFF"
|
||||||
|
export ARCH_FLAG="-m64"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake -DMSGPACK_CXX11=${CXX11} -DMSGPACK_CXX17=${CXX17} -DMSGPACK_32BIT=${BIT32} -DMSGPACK_BOOST=${BOOST} -DBUILD_SHARED_LIBS=${SHARED} -DMSGPACK_CHAR_SIGN=${CHAR_SIGN} -DMSGPACK_DEFAULT_API_VERSION=${API_VERSION} -DMSGPACK_USE_X3_PARSE=${X3_PARSE} ..
|
cmake \
|
||||||
|
-D CMAKE_PREFIX_PATH="${HOME}/boost-prefix/${ARCH};${HOME}/zlib-prefix/${ARCH}" \
|
||||||
|
-D MSGPACK_BUILD_TESTS=ON \
|
||||||
|
-D ${MSGPACK_CXX_VERSION} \
|
||||||
|
-D MSGPACK_32BIT=${BIT32} \
|
||||||
|
-D MSGPACK_CHAR_SIGN=${CHAR_SIGN} \
|
||||||
|
-D MSGPACK_DEFAULT_API_VERSION=${API_VERSION} \
|
||||||
|
-D MSGPACK_USE_X3_PARSE=${X3_PARSE} \
|
||||||
|
-D CMAKE_CXX_FLAGS="${CXXFLAGS} ${ARCH_FLAG}" \
|
||||||
|
-D CMAKE_INSTALL_PREFIX=$prefix_dir \
|
||||||
|
-B $build_dir \
|
||||||
|
-S . || exit 1
|
||||||
|
|
||||||
ret=$?
|
cmake --build $build_dir --target install || exit 1
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
make
|
ctest -VV --test-dir $build_dir || exit 1
|
||||||
|
|
||||||
ret=$?
|
if [ "${ARCH}" != "32" ] && [ `uname` = "Linux" ]; then
|
||||||
if [ $ret -ne 0 ]
|
ctest -T memcheck --test-dir $build_dir | tee memcheck.log
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
ctest -VV
|
|
||||||
|
|
||||||
ret=$?
|
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
make install DESTDIR=`pwd`/install
|
|
||||||
|
|
||||||
ret=$?
|
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}" != "32" ] && [ `uname` = "Linux" ]
|
|
||||||
then
|
|
||||||
ctest -T memcheck | tee memcheck.log
|
|
||||||
|
|
||||||
ret=${PIPESTATUS[0]}
|
ret=${PIPESTATUS[0]}
|
||||||
if [ $ret -ne 0 ]
|
if [ $ret -ne 0 ]
|
||||||
@@ -72,4 +46,15 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
if [ "${ARCH}" != "32" ]; then
|
||||||
|
cd test-install || exit 1
|
||||||
|
|
||||||
|
mkdir $build_dir
|
||||||
|
cmake \
|
||||||
|
-D CMAKE_PREFIX_PATH="$prefix_dir;${HOME}/boost-prefix/${ARCH}" \
|
||||||
|
-B $build_dir \
|
||||||
|
-S . || exit 1
|
||||||
|
cmake --build $build_dir --target all || exit 1
|
||||||
|
|
||||||
|
$build_dir/test-install || exit 1
|
||||||
|
fi
|
||||||
|
@@ -1,20 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
mkdir -p build
|
build_dir="$CXX-build"
|
||||||
|
mkdir $build_dir || exit 1
|
||||||
ret=$?
|
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd build
|
|
||||||
|
|
||||||
ret=$?
|
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${ARCH}" == "32" ]
|
if [ "${ARCH}" == "32" ]
|
||||||
then
|
then
|
||||||
@@ -22,28 +9,17 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake -DMSGPACK_FUZZ_REGRESSION="ON" -DMSGPACK_CXX11="ON" -DMSGPACK_BOOST=${BOOST} -DMSGPACK_SAN=${MSGPACK_SAN} -v ..
|
cmake \
|
||||||
|
-D CMAKE_PREFIX_PATH="${HOME}/boost-prefix/${ARCH};${HOME}/zlib-prefix/${ARCH}" \
|
||||||
|
-D MSGPACK_FUZZ_REGRESSION="ON" \
|
||||||
|
-D ${MSGPACK_CXX_VERSION} \
|
||||||
|
-D MSGPACK_CHAR_SIGN=${CHAR_SIGN} \
|
||||||
|
-D MSGPACK_DEFAULT_API_VERSION=${API_VERSION} \
|
||||||
|
-D MSGPACK_USE_X3_PARSE=${X3_PARSE} \
|
||||||
|
-D CMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||||
|
-B $build_dir \
|
||||||
|
-S . || exit 1
|
||||||
|
|
||||||
ret=$?
|
cmake --build $build_dir --target all || exit 1
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
make
|
ctest -VV --test-dir $build_dir || exit 1
|
||||||
|
|
||||||
ret=$?
|
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
make test
|
|
||||||
|
|
||||||
ret=$?
|
|
||||||
if [ $ret -ne 0 ]
|
|
||||||
then
|
|
||||||
exit $ret
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
17
ci/set_gcc_10.sh
Executable file
17
ci/set_gcc_10.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
version=10
|
||||||
|
priority=100
|
||||||
|
|
||||||
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${version} ${priority}
|
||||||
|
sudo update-alternatives --install /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-${version} ${priority}
|
||||||
|
sudo update-alternatives --install /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-${version} ${priority}
|
||||||
|
sudo update-alternatives --install /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-${version} ${priority}
|
||||||
|
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-${version} ${priority}
|
||||||
|
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-${version} ${priority}
|
||||||
|
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-${version} ${priority}
|
||||||
|
sudo update-alternatives --install /usr/bin/lto-dump lto-dump /usr/bin/lto-dump-${version} ${priority}
|
||||||
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${version} ${priority}
|
||||||
|
|
||||||
|
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${version} ${priority}
|
||||||
|
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${version} ${priority}
|
55
cmake/CodeCoverage.cmake
Normal file
55
cmake/CodeCoverage.cmake
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Check prereqs
|
||||||
|
FIND_PROGRAM(GCOV_PATH gcov)
|
||||||
|
FIND_PROGRAM(LCOV_PATH lcov)
|
||||||
|
FIND_PROGRAM(GENHTML_PATH genhtml)
|
||||||
|
|
||||||
|
IF(NOT GCOV_PATH)
|
||||||
|
MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
# Clang version 3.0.0 and greater now supports gcov as well.
|
||||||
|
MESSAGE(STATUS "Compiler is not GNU gcc! Clang Version 3.0.0 and greater supports gcov as well, but older versions don't.")
|
||||||
|
IF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES "Clang" AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
|
MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(COVERAGE_FLAGS "-g -O0 --coverage")
|
||||||
|
|
||||||
|
FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
|
||||||
|
|
||||||
|
IF(NOT LCOV_PATH)
|
||||||
|
MESSAGE(FATAL_ERROR "lcov not found! Aborting...")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT GENHTML_PATH)
|
||||||
|
MESSAGE(FATAL_ERROR "genhtml not found! Aborting...")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Setup target
|
||||||
|
ADD_CUSTOM_TARGET(${_targetname}
|
||||||
|
|
||||||
|
# Cleanup lcov
|
||||||
|
${LCOV_PATH} --directory . --zerocounters
|
||||||
|
|
||||||
|
# Run tests
|
||||||
|
COMMAND ${_testrunner} ${ARGV3}
|
||||||
|
|
||||||
|
# Capturing lcov counters and generating report
|
||||||
|
COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info --base-directory ${CMAKE_SOURCE_DIR} --no-external --quiet
|
||||||
|
COMMAND ${LCOV_PATH} --remove ${_outputname}.info '*/test/*' '*/fuzz/*' --output-file ${_outputname}.info.cleaned --quiet
|
||||||
|
COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned --prefix ${CMAKE_SOURCE_DIR}
|
||||||
|
# COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned
|
||||||
|
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
|
||||||
|
)
|
||||||
|
|
||||||
|
# Show info where to find the report
|
||||||
|
ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
|
||||||
|
COMMAND ;
|
||||||
|
COMMENT "Open ./${_outputname}/index.html in your browser to view the coverage report."
|
||||||
|
)
|
||||||
|
|
||||||
|
ENDFUNCTION()
|
36
codecov.yml
Normal file
36
codecov.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
codecov:
|
||||||
|
notify:
|
||||||
|
require_ci_to_pass: yes
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
precision: 2
|
||||||
|
round: down
|
||||||
|
range: "70...100"
|
||||||
|
|
||||||
|
status:
|
||||||
|
project: yes
|
||||||
|
patch: yes
|
||||||
|
changes: no
|
||||||
|
|
||||||
|
parsers:
|
||||||
|
gcov:
|
||||||
|
branch_detection:
|
||||||
|
conditional: yes
|
||||||
|
loop: yes
|
||||||
|
method: no
|
||||||
|
macro: no
|
||||||
|
|
||||||
|
comment:
|
||||||
|
layout: "header, diff"
|
||||||
|
behavior: default
|
||||||
|
require_changes: no
|
||||||
|
|
||||||
|
ignore:
|
||||||
|
- "test"
|
||||||
|
- "fuzz"
|
||||||
|
- "erb"
|
||||||
|
- "ci"
|
||||||
|
- "cmake"
|
||||||
|
- "examle"
|
||||||
|
- "external"
|
||||||
|
- "usr"
|
@@ -121,7 +121,7 @@ inline tuple<> make_tuple()
|
|||||||
/// @cond
|
/// @cond
|
||||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||||
inline tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>)
|
tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(A0 const& a0<%1.upto(i) {|j|%>, A<%=j%> const& a<%=j%><%}%>)
|
||||||
{
|
{
|
||||||
return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>);
|
return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>);
|
||||||
}
|
}
|
||||||
|
@@ -54,7 +54,7 @@ tuple<> make_tuple();
|
|||||||
/// @cond
|
/// @cond
|
||||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||||
tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>);
|
tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(A0 const& a0<%1.upto(i) {|j|%>, A<%=j%> const& a<%=j%><%}%>);
|
||||||
<%}%>
|
<%}%>
|
||||||
/// @endcond
|
/// @endcond
|
||||||
|
|
||||||
|
@@ -10,8 +10,17 @@
|
|||||||
#ifndef MSGPACK_V1_CPP03_ZONE_HPP
|
#ifndef MSGPACK_V1_CPP03_ZONE_HPP
|
||||||
#define MSGPACK_V1_CPP03_ZONE_HPP
|
#define MSGPACK_V1_CPP03_ZONE_HPP
|
||||||
|
|
||||||
|
#include "msgpack/versioning.hpp"
|
||||||
|
#include "msgpack/cpp_config.hpp"
|
||||||
#include "msgpack/zone_decl.hpp"
|
#include "msgpack/zone_decl.hpp"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include <boost/assert.hpp>
|
||||||
|
|
||||||
<% GENERATION_LIMIT = 15 %>
|
<% GENERATION_LIMIT = 15 %>
|
||||||
namespace msgpack {
|
namespace msgpack {
|
||||||
|
|
||||||
@@ -55,7 +64,7 @@ class zone {
|
|||||||
++m_tail;
|
++m_tail;
|
||||||
}
|
}
|
||||||
void push_expand(void (*func)(void*), void* data) {
|
void push_expand(void (*func)(void*), void* data) {
|
||||||
const size_t nused = m_end - m_array;
|
const size_t nused = static_cast<size_t>(m_end - m_array);
|
||||||
size_t nnext;
|
size_t nnext;
|
||||||
if(nused == 0) {
|
if(nused == 0) {
|
||||||
nnext = (sizeof(finalizer) < 72/2) ?
|
nnext = (sizeof(finalizer) < 72/2) ?
|
||||||
@@ -192,21 +201,22 @@ inline zone::zone(size_t chunk_size) /* throw() */ :m_chunk_size(chunk_size), m_
|
|||||||
|
|
||||||
inline char* zone::get_aligned(char* ptr, size_t align)
|
inline char* zone::get_aligned(char* ptr, size_t align)
|
||||||
{
|
{
|
||||||
|
BOOST_ASSERT(align != 0 && (align & (align - 1)) == 0); // align must be 2^n (n >= 0)
|
||||||
return
|
return
|
||||||
reinterpret_cast<char*>(
|
reinterpret_cast<char*>(
|
||||||
reinterpret_cast<size_t>(
|
reinterpret_cast<uintptr_t>(ptr + (align - 1)) & ~static_cast<uintptr_t>(align - 1)
|
||||||
(ptr + (align - 1))) / align * align);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void* zone::allocate_align(size_t size, size_t align)
|
inline void* zone::allocate_align(size_t size, size_t align)
|
||||||
{
|
{
|
||||||
char* aligned = get_aligned(m_chunk_list.m_ptr, align);
|
char* aligned = get_aligned(m_chunk_list.m_ptr, align);
|
||||||
size_t adjusted_size = size + (aligned - m_chunk_list.m_ptr);
|
size_t adjusted_size = size + static_cast<size_t>(aligned - m_chunk_list.m_ptr);
|
||||||
if (m_chunk_list.m_free < adjusted_size) {
|
if (m_chunk_list.m_free < adjusted_size) {
|
||||||
size_t enough_size = size + align - 1;
|
size_t enough_size = size + align - 1;
|
||||||
char* ptr = allocate_expand(enough_size);
|
char* ptr = allocate_expand(enough_size);
|
||||||
aligned = get_aligned(ptr, align);
|
aligned = get_aligned(ptr, align);
|
||||||
adjusted_size = size + (aligned - m_chunk_list.m_ptr);
|
adjusted_size = size + static_cast<size_t>(aligned - m_chunk_list.m_ptr);
|
||||||
}
|
}
|
||||||
m_chunk_list.m_free -= adjusted_size;
|
m_chunk_list.m_free -= adjusted_size;
|
||||||
m_chunk_list.m_ptr += adjusted_size;
|
m_chunk_list.m_ptr += adjusted_size;
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
ADD_SUBDIRECTORY (c)
|
|
||||||
ADD_SUBDIRECTORY (cpp03)
|
ADD_SUBDIRECTORY (cpp03)
|
||||||
ADD_SUBDIRECTORY (cpp11)
|
ADD_SUBDIRECTORY (cpp11)
|
||||||
ADD_SUBDIRECTORY (boost)
|
ADD_SUBDIRECTORY (boost)
|
||||||
|
@@ -1,21 +1,16 @@
|
|||||||
IF (MSGPACK_BOOST)
|
FIND_PACKAGE (Boost REQUIRED COMPONENTS system)
|
||||||
LIST (APPEND exec_PROGRAMS
|
FIND_PACKAGE (Threads REQUIRED)
|
||||||
msgpack_variant_capitalize.cpp
|
FIND_PACKAGE (ZLIB REQUIRED)
|
||||||
msgpack_variant_mapbased.cpp
|
|
||||||
)
|
LIST (APPEND exec_PROGRAMS
|
||||||
IF (MSGPACK_CXX11 OR MSGPACK_CXX17)
|
msgpack_variant_capitalize.cpp
|
||||||
FIND_PACKAGE (Threads REQUIRED)
|
msgpack_variant_mapbased.cpp
|
||||||
LIST (APPEND exec_PROGRAMS
|
)
|
||||||
asio_send_recv.cpp
|
|
||||||
)
|
IF (MSGPACK_CXX11 OR MSGPACK_CXX14 OR MSGPACK_CXX17 OR MSGPACK_CXX20)
|
||||||
IF (ZLIB_FOUND)
|
LIST (APPEND exec_PROGRAMS asio_send_recv.cpp)
|
||||||
INCLUDE_DIRECTORIES (
|
IF (ZLIB_FOUND)
|
||||||
${ZLIB_INCLUDE_DIRS}
|
LIST (APPEND exec_PROGRAMS asio_send_recv_zlib.cpp)
|
||||||
)
|
|
||||||
LIST (APPEND exec_PROGRAMS
|
|
||||||
asio_send_recv_zlib.cpp
|
|
||||||
)
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
@@ -25,24 +20,19 @@ FOREACH (source_file ${exec_PROGRAMS})
|
|||||||
${source_file_we}
|
${source_file_we}
|
||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
|
||||||
PRIVATE
|
msgpackc-cxx
|
||||||
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
|
Boost::system
|
||||||
)
|
Threads::Threads
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
|
||||||
${Boost_SYSTEM_LIBRARY}
|
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
|
||||||
)
|
)
|
||||||
IF (ZLIB_FOUND)
|
IF (ZLIB_FOUND)
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE ZLIB::ZLIB)
|
||||||
${ZLIB_LIBRARIES}
|
ENDIF ()
|
||||||
)
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
ENDIF()
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
|
@@ -38,8 +38,8 @@ int main() {
|
|||||||
std::cout << __LINE__ << ":" << e.message() << std::endl;
|
std::cout << __LINE__ << ":" << e.message() << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
unp.reserve_buffer(window_size);
|
|
||||||
do_async_read_some = [&] {
|
do_async_read_some = [&] {
|
||||||
|
unp.reserve_buffer(window_size);
|
||||||
ss.async_read_some(
|
ss.async_read_some(
|
||||||
boost::asio::buffer(unp.buffer(), window_size),
|
boost::asio::buffer(unp.buffer(), window_size),
|
||||||
[&](boost::system::error_code const& e, std::size_t bytes_transferred) {
|
[&](boost::system::error_code const& e, std::size_t bytes_transferred) {
|
||||||
|
@@ -85,12 +85,12 @@ int main() {
|
|||||||
}
|
}
|
||||||
std::cout << bytes_transferred << " bytes read." << std::endl;
|
std::cout << bytes_transferred << " bytes read." << std::endl;
|
||||||
print(std::string(std::string(&buf[0], buf.size())));
|
print(std::string(std::string(&buf[0], buf.size())));
|
||||||
strm.avail_in = bytes_transferred;
|
strm.avail_in = static_cast<uInt>(bytes_transferred);
|
||||||
do {
|
do {
|
||||||
strm.next_in = reinterpret_cast<unsigned char*>(&buf[0]) + (bytes_transferred - strm.avail_in);
|
strm.next_in = reinterpret_cast<unsigned char*>(&buf[0]) + (bytes_transferred - strm.avail_in);
|
||||||
int zret;
|
int zret;
|
||||||
unp.reserve_buffer(window_size);
|
unp.reserve_buffer(window_size);
|
||||||
strm.avail_out = window_size;
|
strm.avail_out = static_cast<uInt>(window_size);
|
||||||
strm.next_out = reinterpret_cast<unsigned char*>(unp.buffer());
|
strm.next_out = reinterpret_cast<unsigned char*>(unp.buffer());
|
||||||
do {
|
do {
|
||||||
zret = inflate(&strm, Z_NO_FLUSH);
|
zret = inflate(&strm, Z_NO_FLUSH);
|
||||||
|
@@ -83,7 +83,8 @@ int main() {
|
|||||||
u.address = "Tokyo";
|
u.address = "Tokyo";
|
||||||
msgpack::pack(ss, u);
|
msgpack::pack(ss, u);
|
||||||
|
|
||||||
msgpack::object_handle oh = msgpack::unpack(ss.str().data(), ss.str().size());
|
std::string const& str = ss.str();
|
||||||
|
msgpack::object_handle oh = msgpack::unpack(str.data(), str.size());
|
||||||
msgpack::object const& obj = oh.get();
|
msgpack::object const& obj = oh.get();
|
||||||
std::cout << "Unpacked msgpack object." << std::endl;
|
std::cout << "Unpacked msgpack object." << std::endl;
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
|
@@ -1,42 +0,0 @@
|
|||||||
IF (MSGPACK_ENABLE_SHARED)
|
|
||||||
SET (MSGPACK_LIB msgpackc)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF (MSGPACK_ENABLE_STATIC)
|
|
||||||
SET (MSGPACK_LIB msgpackc-static)
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
|
|
||||||
LIST (APPEND exec_PROGRAMS
|
|
||||||
lib_buffer_unpack.c
|
|
||||||
simple_c.c
|
|
||||||
speed_test_uint32_array.c
|
|
||||||
speed_test_uint64_array.c
|
|
||||||
user_buffer_unpack.c
|
|
||||||
)
|
|
||||||
|
|
||||||
FOREACH (source_file ${exec_PROGRAMS})
|
|
||||||
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
|
||||||
ADD_EXECUTABLE (
|
|
||||||
${source_file_we}
|
|
||||||
${source_file}
|
|
||||||
)
|
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
|
||||||
${MSGPACK_LIB}
|
|
||||||
)
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
|
||||||
ENDIF ()
|
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
||||||
IF (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
|
||||||
STRING(REGEX REPLACE "/W[0-4]" "/W3 /WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
||||||
ELSE ()
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /WX")
|
|
||||||
ENDIF ()
|
|
||||||
ENDIF ()
|
|
||||||
ENDFOREACH ()
|
|
@@ -1,127 +0,0 @@
|
|||||||
#include <msgpack.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct receiver {
|
|
||||||
msgpack_sbuffer sbuf;
|
|
||||||
size_t rest;
|
|
||||||
} receiver;
|
|
||||||
|
|
||||||
void receiver_init(receiver *r) {
|
|
||||||
msgpack_packer pk;
|
|
||||||
|
|
||||||
msgpack_sbuffer_init(&r->sbuf);
|
|
||||||
msgpack_packer_init(&pk, &r->sbuf, msgpack_sbuffer_write);
|
|
||||||
/* 1st object */
|
|
||||||
msgpack_pack_array(&pk, 3);
|
|
||||||
msgpack_pack_int(&pk, 1);
|
|
||||||
msgpack_pack_true(&pk);
|
|
||||||
msgpack_pack_str(&pk, 7);
|
|
||||||
msgpack_pack_str_body(&pk, "example", 7);
|
|
||||||
/* 2nd object */
|
|
||||||
msgpack_pack_str(&pk, 6);
|
|
||||||
msgpack_pack_str_body(&pk, "second", 6);
|
|
||||||
/* 3rd object */
|
|
||||||
msgpack_pack_array(&pk, 2);
|
|
||||||
msgpack_pack_int(&pk, 42);
|
|
||||||
msgpack_pack_false(&pk);
|
|
||||||
r->rest = r->sbuf.size;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t receiver_recv(receiver *r, char* buf, size_t try_size) {
|
|
||||||
size_t off = r->sbuf.size - r->rest;
|
|
||||||
|
|
||||||
size_t actual_size = try_size;
|
|
||||||
if (actual_size > r->rest) actual_size = r->rest;
|
|
||||||
|
|
||||||
memcpy(buf, r->sbuf.data + off, actual_size);
|
|
||||||
r->rest -= actual_size;
|
|
||||||
|
|
||||||
return actual_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t receiver_to_unpacker(receiver* r, size_t request_size,
|
|
||||||
msgpack_unpacker *unpacker)
|
|
||||||
{
|
|
||||||
size_t recv_len;
|
|
||||||
// make sure there's enough room, or expand the unpacker accordingly
|
|
||||||
if (msgpack_unpacker_buffer_capacity(unpacker) < request_size) {
|
|
||||||
msgpack_unpacker_reserve_buffer(unpacker, request_size);
|
|
||||||
assert(msgpack_unpacker_buffer_capacity(unpacker) >= request_size);
|
|
||||||
}
|
|
||||||
recv_len = receiver_recv(r, msgpack_unpacker_buffer(unpacker),
|
|
||||||
request_size);
|
|
||||||
msgpack_unpacker_buffer_consumed(unpacker, recv_len);
|
|
||||||
return recv_len;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EACH_RECV_SIZE 4
|
|
||||||
|
|
||||||
void unpack(receiver* r) {
|
|
||||||
/* buf is allocated by unpacker. */
|
|
||||||
msgpack_unpacker* unp = msgpack_unpacker_new(100);
|
|
||||||
msgpack_unpacked result;
|
|
||||||
msgpack_unpack_return ret;
|
|
||||||
size_t recv_len;
|
|
||||||
int recv_count = 0;
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
msgpack_unpacked_init(&result);
|
|
||||||
while (true) {
|
|
||||||
recv_len = receiver_to_unpacker(r, EACH_RECV_SIZE, unp);
|
|
||||||
if (recv_len == 0) break; // (reached end of input)
|
|
||||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
|
||||||
printf("receive count: %d %Id bytes received.\n", recv_count++, recv_len);
|
|
||||||
#else // defined(_MSC_VER) || defined(__MINGW32__)
|
|
||||||
printf("receive count: %d %zd bytes received.\n", recv_count++, recv_len);
|
|
||||||
#endif // defined(_MSC_VER) || defined(__MINGW32__)
|
|
||||||
ret = msgpack_unpacker_next(unp, &result);
|
|
||||||
while (ret == MSGPACK_UNPACK_SUCCESS) {
|
|
||||||
msgpack_object obj = result.data;
|
|
||||||
|
|
||||||
/* Use obj. */
|
|
||||||
printf("Object no %d:\n", ++i);
|
|
||||||
msgpack_object_print(stdout, obj);
|
|
||||||
printf("\n");
|
|
||||||
/* If you want to allocate something on the zone, you can use zone. */
|
|
||||||
/* msgpack_zone* zone = result.zone; */
|
|
||||||
/* The lifetime of the obj and the zone, */
|
|
||||||
|
|
||||||
ret = msgpack_unpacker_next(unp, &result);
|
|
||||||
}
|
|
||||||
if (ret == MSGPACK_UNPACK_PARSE_ERROR) {
|
|
||||||
printf("The data in the buf is invalid format.\n");
|
|
||||||
msgpack_unpacked_destroy(&result);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
msgpack_unpacked_destroy(&result);
|
|
||||||
msgpack_unpacker_free(unp);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
receiver r;
|
|
||||||
receiver_init(&r);
|
|
||||||
|
|
||||||
unpack(&r);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Output */
|
|
||||||
|
|
||||||
/*
|
|
||||||
receive count: 0 4 bytes received.
|
|
||||||
receive count: 1 4 bytes received.
|
|
||||||
receive count: 2 4 bytes received.
|
|
||||||
Object no 1:
|
|
||||||
[1, true, "example"]
|
|
||||||
receive count: 3 4 bytes received.
|
|
||||||
receive count: 4 4 bytes received.
|
|
||||||
Object no 2:
|
|
||||||
"second"
|
|
||||||
receive count: 5 1 bytes received.
|
|
||||||
Object no 3:
|
|
||||||
[42, false]
|
|
||||||
*/
|
|
@@ -1,47 +0,0 @@
|
|||||||
#include <msgpack.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
void print(char const* buf, unsigned int len)
|
|
||||||
{
|
|
||||||
size_t i = 0;
|
|
||||||
for(; i < len ; ++i)
|
|
||||||
printf("%02x ", 0xff & buf[i]);
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
msgpack_sbuffer sbuf;
|
|
||||||
msgpack_packer pk;
|
|
||||||
msgpack_zone mempool;
|
|
||||||
msgpack_object deserialized;
|
|
||||||
|
|
||||||
/* msgpack::sbuffer is a simple buffer implementation. */
|
|
||||||
msgpack_sbuffer_init(&sbuf);
|
|
||||||
|
|
||||||
/* serialize values into the buffer using msgpack_sbuffer_write callback function. */
|
|
||||||
msgpack_packer_init(&pk, &sbuf, msgpack_sbuffer_write);
|
|
||||||
|
|
||||||
msgpack_pack_array(&pk, 3);
|
|
||||||
msgpack_pack_int(&pk, 1);
|
|
||||||
msgpack_pack_true(&pk);
|
|
||||||
msgpack_pack_str(&pk, 7);
|
|
||||||
msgpack_pack_str_body(&pk, "example", 7);
|
|
||||||
|
|
||||||
print(sbuf.data, sbuf.size);
|
|
||||||
|
|
||||||
/* deserialize the buffer into msgpack_object instance. */
|
|
||||||
/* deserialized object is valid during the msgpack_zone instance alive. */
|
|
||||||
msgpack_zone_init(&mempool, 2048);
|
|
||||||
|
|
||||||
msgpack_unpack(sbuf.data, sbuf.size, NULL, &mempool, &deserialized);
|
|
||||||
|
|
||||||
/* print the deserialized object. */
|
|
||||||
msgpack_object_print(stdout, deserialized);
|
|
||||||
puts("");
|
|
||||||
|
|
||||||
msgpack_zone_destroy(&mempool);
|
|
||||||
msgpack_sbuffer_destroy(&sbuf);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
@@ -1,36 +0,0 @@
|
|||||||
#include <msgpack.h>
|
|
||||||
|
|
||||||
void test()
|
|
||||||
{
|
|
||||||
size_t size = 10000000;
|
|
||||||
msgpack_sbuffer buf;
|
|
||||||
msgpack_packer * pk;
|
|
||||||
size_t upk_pos = 0;
|
|
||||||
msgpack_unpacked msg;
|
|
||||||
|
|
||||||
msgpack_sbuffer_init(&buf);
|
|
||||||
|
|
||||||
pk = msgpack_packer_new(&buf, msgpack_sbuffer_write);
|
|
||||||
|
|
||||||
msgpack_pack_array(pk, size);
|
|
||||||
{
|
|
||||||
size_t idx = 0;
|
|
||||||
for (; idx < size; ++idx)
|
|
||||||
msgpack_pack_uint32(pk, 1);
|
|
||||||
}
|
|
||||||
msgpack_packer_free(pk);
|
|
||||||
|
|
||||||
msgpack_unpacked_init(&msg);
|
|
||||||
|
|
||||||
while (msgpack_unpack_next(&msg, buf.data, buf.size, &upk_pos) == MSGPACK_UNPACK_SUCCESS) {
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_sbuffer_destroy(&buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
for (; i < 10; ++i) test();
|
|
||||||
return 0;
|
|
||||||
}
|
|
@@ -1,37 +0,0 @@
|
|||||||
#include <msgpack.h>
|
|
||||||
|
|
||||||
void test()
|
|
||||||
{
|
|
||||||
uint64_t test_u64 = 0xFFF0000000000001LL;
|
|
||||||
size_t size = 10000000;
|
|
||||||
msgpack_sbuffer buf;
|
|
||||||
msgpack_packer * pk;
|
|
||||||
size_t upk_pos = 0;
|
|
||||||
msgpack_unpacked msg;
|
|
||||||
|
|
||||||
msgpack_sbuffer_init(&buf);
|
|
||||||
|
|
||||||
pk = msgpack_packer_new(&buf, msgpack_sbuffer_write);
|
|
||||||
|
|
||||||
msgpack_pack_array(pk, size);
|
|
||||||
{
|
|
||||||
size_t idx = 0;
|
|
||||||
for (; idx < size; ++idx)
|
|
||||||
msgpack_pack_uint64(pk, test_u64);
|
|
||||||
}
|
|
||||||
msgpack_packer_free(pk);
|
|
||||||
|
|
||||||
msgpack_unpacked_init(&msg);
|
|
||||||
|
|
||||||
while (msgpack_unpack_next(&msg, buf.data, buf.size, &upk_pos) == MSGPACK_UNPACK_SUCCESS) {
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_sbuffer_destroy(&buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
for (; i < 10; ++i) test();
|
|
||||||
return 0;
|
|
||||||
}
|
|
@@ -1,81 +0,0 @@
|
|||||||
#include <msgpack.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#define UNPACKED_BUFFER_SIZE 2048
|
|
||||||
|
|
||||||
void prepare(msgpack_sbuffer* sbuf) {
|
|
||||||
msgpack_packer pk;
|
|
||||||
|
|
||||||
msgpack_packer_init(&pk, sbuf, msgpack_sbuffer_write);
|
|
||||||
/* 1st object */
|
|
||||||
msgpack_pack_array(&pk, 3);
|
|
||||||
msgpack_pack_int(&pk, 1);
|
|
||||||
msgpack_pack_true(&pk);
|
|
||||||
msgpack_pack_str(&pk, 7);
|
|
||||||
msgpack_pack_str_body(&pk, "example", 7);
|
|
||||||
/* 2nd object */
|
|
||||||
msgpack_pack_str(&pk, 6);
|
|
||||||
msgpack_pack_str_body(&pk, "second", 6);
|
|
||||||
/* 3rd object */
|
|
||||||
msgpack_pack_array(&pk, 2);
|
|
||||||
msgpack_pack_int(&pk, 42);
|
|
||||||
msgpack_pack_false(&pk);
|
|
||||||
}
|
|
||||||
|
|
||||||
void unpack(char const* buf, size_t len) {
|
|
||||||
/* buf is allocated by client. */
|
|
||||||
msgpack_unpacked result;
|
|
||||||
size_t off = 0;
|
|
||||||
msgpack_unpack_return ret;
|
|
||||||
int i = 0;
|
|
||||||
char unpacked_buffer[UNPACKED_BUFFER_SIZE];
|
|
||||||
msgpack_unpacked_init(&result);
|
|
||||||
ret = msgpack_unpack_next(&result, buf, len, &off);
|
|
||||||
while (ret == MSGPACK_UNPACK_SUCCESS) {
|
|
||||||
msgpack_object obj = result.data;
|
|
||||||
|
|
||||||
/* Use obj. */
|
|
||||||
printf("Object no %d:\n", ++i);
|
|
||||||
msgpack_object_print(stdout, obj);
|
|
||||||
printf("\n");
|
|
||||||
msgpack_object_print_buffer(unpacked_buffer, UNPACKED_BUFFER_SIZE, obj);
|
|
||||||
printf("%s\n", unpacked_buffer);
|
|
||||||
/* If you want to allocate something on the zone, you can use zone. */
|
|
||||||
/* msgpack_zone* zone = result.zone; */
|
|
||||||
/* The lifetime of the obj and the zone, */
|
|
||||||
|
|
||||||
ret = msgpack_unpack_next(&result, buf, len, &off);
|
|
||||||
}
|
|
||||||
msgpack_unpacked_destroy(&result);
|
|
||||||
|
|
||||||
if (ret == MSGPACK_UNPACK_CONTINUE) {
|
|
||||||
printf("All msgpack_object in the buffer is consumed.\n");
|
|
||||||
}
|
|
||||||
else if (ret == MSGPACK_UNPACK_PARSE_ERROR) {
|
|
||||||
printf("The data in the buf is invalid format.\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
msgpack_sbuffer sbuf;
|
|
||||||
msgpack_sbuffer_init(&sbuf);
|
|
||||||
|
|
||||||
prepare(&sbuf);
|
|
||||||
unpack(sbuf.data, sbuf.size);
|
|
||||||
|
|
||||||
msgpack_sbuffer_destroy(&sbuf);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Output */
|
|
||||||
|
|
||||||
/*
|
|
||||||
Object no 1:
|
|
||||||
[1, true, "example"]
|
|
||||||
Object no 2:
|
|
||||||
"second"
|
|
||||||
Object no 3:
|
|
||||||
[42, false]
|
|
||||||
All msgpack_object in the buffer is consumed.
|
|
||||||
*/
|
|
@@ -1,3 +1,7 @@
|
|||||||
|
FIND_PACKAGE (Threads REQUIRED)
|
||||||
|
|
||||||
|
FIND_PACKAGE (Boost COMPONENTS timer)
|
||||||
|
|
||||||
LIST (APPEND exec_PROGRAMS
|
LIST (APPEND exec_PROGRAMS
|
||||||
class_intrusive.cpp
|
class_intrusive.cpp
|
||||||
class_intrusive_map.cpp
|
class_intrusive_map.cpp
|
||||||
@@ -22,12 +26,12 @@ IF (NOT MSVC)
|
|||||||
)
|
)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF (MSGPACK_BOOST)
|
if (Boost_TIMER_LIBRARY)
|
||||||
LIST (APPEND with_boost_lib_PROGRAMS
|
LIST (APPEND with_boost_lib_PROGRAMS
|
||||||
speed_test.cpp
|
speed_test.cpp
|
||||||
speed_test_nested_array.cpp
|
speed_test_nested_array.cpp
|
||||||
)
|
)
|
||||||
ENDIF ()
|
endif()
|
||||||
|
|
||||||
FOREACH (source_file ${exec_PROGRAMS})
|
FOREACH (source_file ${exec_PROGRAMS})
|
||||||
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
||||||
@@ -35,11 +39,10 @@ FOREACH (source_file ${exec_PROGRAMS})
|
|||||||
${source_file_we}
|
${source_file_we}
|
||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
|
||||||
PRIVATE
|
msgpackc-cxx
|
||||||
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
|
|
||||||
)
|
)
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
@@ -57,14 +60,11 @@ FOREACH (source_file ${with_pthread_PROGRAMS})
|
|||||||
${source_file_we}
|
${source_file_we}
|
||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
|
||||||
PRIVATE
|
msgpackc-cxx
|
||||||
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
|
Threads::Threads
|
||||||
)
|
)
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
|
||||||
)
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
@@ -77,36 +77,26 @@ FOREACH (source_file ${with_pthread_PROGRAMS})
|
|||||||
ENDFOREACH ()
|
ENDFOREACH ()
|
||||||
|
|
||||||
FOREACH (source_file ${with_boost_lib_PROGRAMS})
|
FOREACH (source_file ${with_boost_lib_PROGRAMS})
|
||||||
INCLUDE_DIRECTORIES (
|
|
||||||
../include
|
|
||||||
${Boost_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
||||||
ADD_EXECUTABLE (
|
ADD_EXECUTABLE (
|
||||||
${source_file_we}
|
${source_file_we}
|
||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
|
||||||
PRIVATE
|
msgpackc-cxx
|
||||||
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
|
Boost::timer
|
||||||
)
|
|
||||||
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
|
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
|
||||||
${Boost_TIMER_LIBRARY}
|
|
||||||
${Boost_CHRONO_LIBRARY}
|
|
||||||
${Boost_SYSTEM_LIBRARY}
|
|
||||||
)
|
)
|
||||||
IF (NOT MSVC AND NOT APPLE)
|
IF (NOT MSVC AND NOT APPLE)
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
|
||||||
rt
|
rt
|
||||||
)
|
)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -O3")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Werror -O3")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
|
@@ -82,10 +82,11 @@ int main() {
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
msgpack::pack(ss, my);
|
msgpack::pack(ss, my);
|
||||||
|
|
||||||
print(ss.str());
|
std::string const& str = ss.str();
|
||||||
|
print(str);
|
||||||
|
|
||||||
msgpack::object_handle oh =
|
msgpack::object_handle oh =
|
||||||
msgpack::unpack(ss.str().data(), ss.str().size());
|
msgpack::unpack(str.data(), str.size());
|
||||||
msgpack::object obj = oh.get();
|
msgpack::object obj = oh.get();
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
assert(obj.as<my_class>() == my);
|
assert(obj.as<my_class>() == my);
|
||||||
|
@@ -59,8 +59,9 @@ int main() {
|
|||||||
|
|
||||||
print(ss.str());
|
print(ss.str());
|
||||||
|
|
||||||
|
std::string const& str = ss.str();
|
||||||
msgpack::object_handle oh =
|
msgpack::object_handle oh =
|
||||||
msgpack::unpack(ss.str().data(), ss.str().size());
|
msgpack::unpack(str.data(), str.size());
|
||||||
msgpack::object obj = oh.get();
|
msgpack::object obj = oh.get();
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
assert(obj.as<my_class>() == my);
|
assert(obj.as<my_class>() == my);
|
||||||
|
@@ -100,10 +100,11 @@ int main() {
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
msgpack::pack(ss, my);
|
msgpack::pack(ss, my);
|
||||||
|
|
||||||
print(ss.str());
|
std::string const& str = ss.str();
|
||||||
|
print(str);
|
||||||
|
|
||||||
msgpack::object_handle oh =
|
msgpack::object_handle oh =
|
||||||
msgpack::unpack(ss.str().data(), ss.str().size());
|
msgpack::unpack(str.data(), str.size());
|
||||||
msgpack::object obj = oh.get();
|
msgpack::object obj = oh.get();
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
assert(obj.as<my_class>() == my);
|
assert(obj.as<my_class>() == my);
|
||||||
|
@@ -71,7 +71,8 @@ int main() {
|
|||||||
|
|
||||||
print(ss.str());
|
print(ss.str());
|
||||||
|
|
||||||
msgpack::object_handle oh = msgpack::unpack(ss.str().data(), ss.str().size());
|
std::string const& str = ss.str();
|
||||||
|
msgpack::object_handle oh = msgpack::unpack(str.data(), str.size());
|
||||||
|
|
||||||
msgpack::object obj = oh.get();
|
msgpack::object obj = oh.get();
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
|
@@ -31,12 +31,13 @@ int main() {
|
|||||||
std::size_t offset = 0;
|
std::size_t offset = 0;
|
||||||
|
|
||||||
// msgpack array is constructed on z.
|
// msgpack array is constructed on z.
|
||||||
msgpack::object obj = msgpack::unpack(z, ss.str().data(), ss.str().size(), offset);
|
std::string const& ps = ss.str();
|
||||||
|
msgpack::object obj = msgpack::unpack(z, ps.data(), ps.size(), offset);
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
assert(obj.as<std::vector<int> >() == v);
|
assert(obj.as<std::vector<int> >() == v);
|
||||||
|
|
||||||
// msgpack str is constructed on z.
|
// msgpack str is constructed on z.
|
||||||
std::string const& str = msgpack::unpack(z, ss.str().data(), ss.str().size(), offset).as<std::string>();
|
std::string const& str = msgpack::unpack(z, ps.data(), ps.size(), offset).as<std::string>();
|
||||||
std::cout << str << std::endl;
|
std::cout << str << std::endl;
|
||||||
assert(str == s);
|
assert(str == s);
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
IF (MSGPACK_CXX11)
|
IF (MSGPACK_CXX11 OR MSGPACK_CXX14 OR MSGPACK_CXX17)
|
||||||
INCLUDE_DIRECTORIES (
|
|
||||||
../include
|
|
||||||
)
|
|
||||||
|
|
||||||
LIST (APPEND exec_PROGRAMS
|
LIST (APPEND exec_PROGRAMS
|
||||||
container.cpp
|
container.cpp
|
||||||
non_def_con_class.cpp
|
non_def_con_class.cpp
|
||||||
@@ -20,15 +16,14 @@ IF (MSGPACK_CXX11)
|
|||||||
${source_file_we}
|
${source_file_we}
|
||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
|
||||||
PRIVATE
|
msgpackc-cxx
|
||||||
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
|
|
||||||
)
|
)
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
|
@@ -25,8 +25,9 @@ void array() {
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
msgpack::pack(ss, a);
|
msgpack::pack(ss, a);
|
||||||
|
|
||||||
msgpack::object_handle oh = msgpack::unpack(ss.str().data(), ss.str().size());
|
auto const& str = ss.str();
|
||||||
msgpack::object obj = oh.get();
|
auto oh = msgpack::unpack(str.data(), str.size());
|
||||||
|
auto obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
assert((obj.as<std::array<int, 5>>()) == a);
|
assert((obj.as<std::array<int, 5>>()) == a);
|
||||||
@@ -37,7 +38,8 @@ void tuple() {
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
msgpack::pack(ss, t);
|
msgpack::pack(ss, t);
|
||||||
|
|
||||||
auto oh = msgpack::unpack(ss.str().data(), ss.str().size());
|
auto const& str = ss.str();
|
||||||
|
auto oh = msgpack::unpack(str.data(), str.size());
|
||||||
auto obj = oh.get();
|
auto obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
@@ -49,7 +51,8 @@ void unordered_map() {
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
msgpack::pack(ss, m);
|
msgpack::pack(ss, m);
|
||||||
|
|
||||||
auto oh = msgpack::unpack(ss.str().data(), ss.str().size());
|
auto const& str = ss.str();
|
||||||
|
auto oh = msgpack::unpack(str.data(), str.size());
|
||||||
msgpack::object obj = oh.get();
|
msgpack::object obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
@@ -61,7 +64,8 @@ void unordered_set() {
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
msgpack::pack(ss, s);
|
msgpack::pack(ss, s);
|
||||||
|
|
||||||
auto oh = msgpack::unpack(ss.str().data(), ss.str().size());
|
auto const& str = ss.str();
|
||||||
|
auto oh = msgpack::unpack(str.data(), str.size());
|
||||||
auto obj = oh.get();
|
auto obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
@@ -74,7 +78,8 @@ void forward_list() {
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
msgpack::pack(ss, f);
|
msgpack::pack(ss, f);
|
||||||
|
|
||||||
auto oh = msgpack::unpack(ss.str().data(), ss.str().size());
|
auto const& str = ss.str();
|
||||||
|
auto oh = msgpack::unpack(str.data(), str.size());
|
||||||
auto obj = oh.get();
|
auto obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
@@ -98,7 +103,8 @@ void combi() {
|
|||||||
std::size_t offset = 0;
|
std::size_t offset = 0;
|
||||||
std::cout << "offset: " << offset << std::endl;
|
std::cout << "offset: " << offset << std::endl;
|
||||||
{
|
{
|
||||||
auto oh = msgpack::unpack(ss.str().data(), ss.str().size(), offset);
|
auto const& str = ss.str();
|
||||||
|
auto oh = msgpack::unpack(str.data(), str.size(), offset);
|
||||||
auto obj = oh.get();
|
auto obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
@@ -106,7 +112,8 @@ void combi() {
|
|||||||
}
|
}
|
||||||
std::cout << "offset: " << offset << std::endl;
|
std::cout << "offset: " << offset << std::endl;
|
||||||
{
|
{
|
||||||
auto oh = msgpack::unpack(ss.str().data(), ss.str().size(), offset);
|
auto const& str = ss.str();
|
||||||
|
auto oh = msgpack::unpack(str.data(), str.size(), offset);
|
||||||
auto obj = oh.get();
|
auto obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
@@ -114,7 +121,8 @@ void combi() {
|
|||||||
}
|
}
|
||||||
std::cout << "offset: " << offset << std::endl;
|
std::cout << "offset: " << offset << std::endl;
|
||||||
{
|
{
|
||||||
auto oh = msgpack::unpack(ss.str().data(), ss.str().size(), offset);
|
auto const& str = ss.str();
|
||||||
|
auto oh = msgpack::unpack(str.data(), str.size(), offset);
|
||||||
auto obj = oh.get();
|
auto obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
@@ -122,7 +130,8 @@ void combi() {
|
|||||||
}
|
}
|
||||||
std::cout << "offset: " << offset << std::endl;
|
std::cout << "offset: " << offset << std::endl;
|
||||||
{
|
{
|
||||||
auto oh = msgpack::unpack(ss.str().data(), ss.str().size(), offset);
|
auto const& str = ss.str();
|
||||||
|
auto oh = msgpack::unpack(str.data(), str.size(), offset);
|
||||||
auto obj = oh.get();
|
auto obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
@@ -130,7 +139,8 @@ void combi() {
|
|||||||
}
|
}
|
||||||
std::cout << "offset: " << offset << std::endl;
|
std::cout << "offset: " << offset << std::endl;
|
||||||
{
|
{
|
||||||
auto oh = msgpack::unpack(ss.str().data(), ss.str().size(), offset);
|
auto const& str = ss.str();
|
||||||
|
auto oh = msgpack::unpack(str.data(), str.size(), offset);
|
||||||
auto obj = oh.get();
|
auto obj = oh.get();
|
||||||
|
|
||||||
std::cout << obj << std::endl;
|
std::cout << obj << std::endl;
|
||||||
|
@@ -1,32 +1,27 @@
|
|||||||
IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
|
IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
|
||||||
INCLUDE_DIRECTORIES (
|
FIND_PACKAGE (Boost REQUIRED COMPONENTS context system unit_test_framework)
|
||||||
../include
|
FIND_PACKAGE (Threads REQUIRED)
|
||||||
)
|
|
||||||
|
|
||||||
LIST (APPEND exec_PROGRAMS
|
LIST (APPEND exec_PROGRAMS
|
||||||
unpack.cpp
|
unpack.cpp
|
||||||
parse.cpp
|
parse.cpp
|
||||||
)
|
)
|
||||||
IF (MSGPACK_BOOST)
|
LIST (APPEND with_boost_PROGRAMS
|
||||||
LIST (APPEND with_boost_PROGRAMS
|
stream_unpack.cpp
|
||||||
stream_unpack.cpp
|
)
|
||||||
)
|
|
||||||
ENDIF ()
|
|
||||||
FOREACH (source_file ${exec_PROGRAMS})
|
FOREACH (source_file ${exec_PROGRAMS})
|
||||||
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
||||||
ADD_EXECUTABLE (
|
ADD_EXECUTABLE (
|
||||||
${source_file_we}
|
${source_file_we}
|
||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE msgpackc-cxx)
|
||||||
PRIVATE
|
|
||||||
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
)
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
@@ -44,20 +39,18 @@ IF (MSGPACK_USE_X3_PARSE AND MSGPACK_DEFAULT_API_VERSION VERSION_GREATER 1)
|
|||||||
${source_file_we}
|
${source_file_we}
|
||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
TARGET_INCLUDE_DIRECTORIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we} PRIVATE
|
||||||
PRIVATE
|
msgpackc-cxx
|
||||||
$<TARGET_PROPERTY:msgpackc,INTERFACE_INCLUDE_DIRECTORIES>
|
Boost::context
|
||||||
|
Boost::system
|
||||||
|
Boost::unit_test_framework
|
||||||
|
Threads::Threads
|
||||||
)
|
)
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
${Boost_CONTEXT_LIBRARY}
|
|
||||||
${Boost_SYSTEM_LIBRARY}
|
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
|
||||||
)
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wall -Wextra")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
|
1
external/boost/predef
vendored
1
external/boost/predef
vendored
Submodule external/boost/predef deleted from 1e8d1c2cfc
1
external/boost/preprocessor
vendored
1
external/boost/preprocessor
vendored
Submodule external/boost/preprocessor deleted from c2beb74b90
@@ -1,21 +1,10 @@
|
|||||||
FIND_PACKAGE (GTest REQUIRED)
|
FIND_PACKAGE (Threads REQUIRED)
|
||||||
FIND_PACKAGE (ZLIB REQUIRED)
|
FIND_PACKAGE (Boost REQUIRED COMPONENTS system filesystem unit_test_framework)
|
||||||
FIND_PACKAGE (Boost REQUIRED COMPONENTS system filesystem)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES (
|
|
||||||
${GTEST_INCLUDE_DIRS}
|
|
||||||
${ZLIB_INCLUDE_DIRS}
|
|
||||||
${Boost_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
LIST (APPEND check_PROGRAMS
|
LIST (APPEND check_PROGRAMS
|
||||||
regression_runner.cpp
|
regression_runner.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
LINK_DIRECTORIES (
|
|
||||||
${Boost_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
FOREACH (source_file ${check_PROGRAMS})
|
FOREACH (source_file ${check_PROGRAMS})
|
||||||
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
|
||||||
ADD_EXECUTABLE (
|
ADD_EXECUTABLE (
|
||||||
@@ -23,14 +12,14 @@ FOREACH (source_file ${check_PROGRAMS})
|
|||||||
${source_file}
|
${source_file}
|
||||||
)
|
)
|
||||||
TARGET_LINK_LIBRARIES (${source_file_we}
|
TARGET_LINK_LIBRARIES (${source_file_we}
|
||||||
msgpackc
|
msgpackc-cxx
|
||||||
${GTEST_BOTH_LIBRARIES}
|
Threads::Threads
|
||||||
${ZLIB_LIBRARIES}
|
Boost::filesystem
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
Boost::system
|
||||||
${Boost_LIBRARIES}
|
Boost::unit_test_framework
|
||||||
)
|
)
|
||||||
ADD_TEST (${source_file_we} ${source_file_we})
|
ADD_TEST (${source_file_we} ${source_file_we})
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||||
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Wno-mismatched-tags -g")
|
SET_PROPERTY (TARGET ${source_file_we} APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -Wno-mismatched-tags -g")
|
||||||
IF ("${MSGPACK_SAN}" STREQUAL "ASAN")
|
IF ("${MSGPACK_SAN}" STREQUAL "ASAN")
|
||||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
|
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
|
||||||
|
@@ -1,50 +1,49 @@
|
|||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
// Use parameterized tests instead of modern data-driven test cases
|
||||||
|
// because BOOST_DATA_TEST_CASE requires C++11 or newer. See:
|
||||||
|
// - https://www.boost.org/doc/libs/1_76_0/libs/test/doc/html/boost_test/tests_organization/test_cases/param_test.html
|
||||||
|
// - https://www.boost.org/doc/libs/1_76_0/libs/test/doc/html/boost_test/tests_organization/test_cases/test_case_generation.html
|
||||||
|
#include <boost/test/included/unit_test.hpp>
|
||||||
|
#include <boost/test/parameterized_test.hpp>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "unpack_pack_fuzzer.cpp"
|
#include "unpack_pack_fuzzer.cpp"
|
||||||
|
|
||||||
using ::testing::TestWithParam;
|
|
||||||
using ::testing::ValuesIn;
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<std::string> ListDirectory(const std::string& path) {
|
std::vector<std::string> ListDirectory(const std::string& path) {
|
||||||
std::vector<std::string> v;
|
std::vector<std::string> v;
|
||||||
|
|
||||||
boost::filesystem::path p(path);
|
boost::filesystem::path p(path);
|
||||||
boost::filesystem::directory_iterator f{p};
|
boost::filesystem::directory_iterator f(p);
|
||||||
|
|
||||||
if(boost::filesystem::is_directory(p)) {
|
if (boost::filesystem::is_directory(p)) {
|
||||||
while (f != boost::filesystem::directory_iterator{}) {
|
while (f != boost::filesystem::directory_iterator()) {
|
||||||
v.push_back((*f++).path().string());
|
v.push_back((*f++).path().string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
class UnpackPackFuzzerRegressionTest : public ::testing::TestWithParam<std::string> {
|
void UnpackPackFuzzerRegressionTest(const std::string& fpath) {
|
||||||
public:
|
std::ifstream in(fpath.c_str(), std::ios_base::binary);
|
||||||
};
|
|
||||||
|
|
||||||
TEST_P(UnpackPackFuzzerRegressionTest, Returns0) {
|
|
||||||
auto fpath = GetParam();
|
|
||||||
std::ifstream in(fpath, std::ifstream::binary);
|
|
||||||
if (!in) {
|
if (!in) {
|
||||||
FAIL() << fpath << " not found";
|
BOOST_FAIL(fpath + " not found");
|
||||||
}
|
}
|
||||||
in.seekg(0, in.end);
|
in.seekg(0, in.end);
|
||||||
size_t length = in.tellg();
|
size_t length = in.tellg();
|
||||||
in.seekg(0, in.beg);
|
in.seekg(0, in.beg);
|
||||||
std::vector<char> bytes(length);
|
std::vector<char> bytes(length);
|
||||||
in.read(bytes.data(), bytes.size());
|
in.read(bytes.data(), bytes.size());
|
||||||
assert(in);
|
BOOST_REQUIRE(in);
|
||||||
EXPECT_EQ(0, LLVMFuzzerTestOneInput(reinterpret_cast<const uint8_t *>(bytes.data()),
|
BOOST_REQUIRE_EQUAL(0, FuzzerTestOneInput(reinterpret_cast<const uint8_t *>(bytes.data()), bytes.size()));
|
||||||
bytes.size()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(UnpackPackFuzzerRegressions,
|
boost::unit_test::test_suite* init_unit_test_suite(int /*argc*/, char* /*argv*/[])
|
||||||
UnpackPackFuzzerRegressionTest,
|
{
|
||||||
::testing::ValuesIn(ListDirectory("../../fuzz/unpack_pack_fuzzer_regressions")));
|
std::vector<std::string> files = ListDirectory("../../fuzz/unpack_pack_fuzzer_regressions");
|
||||||
|
boost::unit_test::framework::master_test_suite().add(BOOST_PARAM_TEST_CASE(&UnpackPackFuzzerRegressionTest, files.begin(), files.end()));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
#include <msgpack.hpp>
|
#include <msgpack.hpp>
|
||||||
|
|
||||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
extern "C" int FuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||||
try {
|
try {
|
||||||
// NOTE(derwolfe): by default the limits are set at 2^32-1 length. I'm
|
// NOTE(derwolfe): by default the limits are set at 2^32-1 length. I'm
|
||||||
// setting these at far smaller values to avoid OOMs
|
// setting these at far smaller values to avoid OOMs
|
||||||
const int test_limit = 1000;
|
const int test_limit = 1000;
|
||||||
msgpack::object_handle unpacked = msgpack::unpack(reinterpret_cast<const char *>(data),
|
msgpack::object_handle unpacked = msgpack::unpack(reinterpret_cast<const char *>(data),
|
||||||
size,
|
size,
|
||||||
nullptr,
|
MSGPACK_NULLPTR,
|
||||||
nullptr,
|
MSGPACK_NULLPTR,
|
||||||
msgpack::unpack_limit(test_limit,
|
msgpack::unpack_limit(test_limit,
|
||||||
test_limit,
|
test_limit,
|
||||||
test_limit,
|
test_limit,
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
* MessagePack for C
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
|
||||||
*
|
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* @defgroup msgpack MessagePack C
|
|
||||||
* @{
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "msgpack/util.h"
|
|
||||||
#include "msgpack/object.h"
|
|
||||||
#include "msgpack/zone.h"
|
|
||||||
#include "msgpack/pack.h"
|
|
||||||
#include "msgpack/unpack.h"
|
|
||||||
#include "msgpack/sbuffer.h"
|
|
||||||
#include "msgpack/vrefbuffer.h"
|
|
||||||
#include "msgpack/version.h"
|
|
||||||
|
|
15
include/msgpack/adaptor/complex.hpp
Normal file
15
include/msgpack/adaptor/complex.hpp
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// MessagePack for C++ static resolution routine
|
||||||
|
//
|
||||||
|
// Copyright (C) 2020 KONDO Takatoshi
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
#ifndef MSGPACK_TYPE_COMPLEX_HPP
|
||||||
|
#define MSGPACK_TYPE_COMPLEX_HPP
|
||||||
|
|
||||||
|
#include "msgpack/v1/adaptor/complex.hpp"
|
||||||
|
|
||||||
|
#endif // MSGPACK_TYPE_COMPLEX_HPP
|
16
include/msgpack/adaptor/cpp11/timespec.hpp
Normal file
16
include/msgpack/adaptor/cpp11/timespec.hpp
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// MessagePack for C++ static resolution routine
|
||||||
|
//
|
||||||
|
// Copyright (C) 2019 KONDO Takatoshi
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef MSGPACK_TYPE_CPP11_TIMESPEC_HPP
|
||||||
|
#define MSGPACK_TYPE_CPP11_TIMESPEC_HPP
|
||||||
|
|
||||||
|
#include "msgpack/v1/adaptor/cpp11/timespec.hpp"
|
||||||
|
|
||||||
|
#endif // MSGPACK_TYPE_CPP11_TIMESPEC_HPP
|
16
include/msgpack/adaptor/cpp17/array_byte.hpp
Normal file
16
include/msgpack/adaptor/cpp17/array_byte.hpp
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// MessagePack for C++ static resolution routine
|
||||||
|
//
|
||||||
|
// Copyright (C) 2021 KONDO Takatoshi
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef MSGPACK_TYPE_CPP17_ARRAY_BYTE_HPP
|
||||||
|
#define MSGPACK_TYPE_CPP17_ARRAY_BYTE_HPP
|
||||||
|
|
||||||
|
#include "msgpack/v1/adaptor/cpp17/array_byte.hpp"
|
||||||
|
|
||||||
|
#endif // MSGPACK_TYPE_CPP17_ARRAY_BYTE_HPP
|
16
include/msgpack/adaptor/cpp20/span.hpp
Normal file
16
include/msgpack/adaptor/cpp20/span.hpp
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// MessagePack for C++ static resolution routine
|
||||||
|
//
|
||||||
|
// Copyright (C) 2021 KONDO Takatoshi
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef MSGPACK_TYPE_CPP20_SPAN_HPP
|
||||||
|
#define MSGPACK_TYPE_CPP20_SPAN_HPP
|
||||||
|
|
||||||
|
#include "msgpack/v1/adaptor/cpp20/span.hpp"
|
||||||
|
|
||||||
|
#endif // MSGPACK_TYPE_CPP20_SPAN_HPP
|
@@ -14,11 +14,11 @@
|
|||||||
// http://www.boost.org/libs/preprocessor/doc/ref/variadics.html
|
// http://www.boost.org/libs/preprocessor/doc/ref/variadics.html
|
||||||
// However, supporting compiler detection is not complete. msgpack-c requires
|
// However, supporting compiler detection is not complete. msgpack-c requires
|
||||||
// variadic macro arguments support. So BOOST_PP_VARIADICS is defined here explicitly.
|
// variadic macro arguments support. So BOOST_PP_VARIADICS is defined here explicitly.
|
||||||
#if !defined(MSGPACK_PP_VARIADICS)
|
#if !defined(BOOST_PP_VARIADICS)
|
||||||
#define MSGPACK_PP_VARIADICS
|
#define BOOST_PP_VARIADICS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <msgpack/preprocessor.hpp>
|
#include <boost/preprocessor.hpp>
|
||||||
|
|
||||||
#include "msgpack/versioning.hpp"
|
#include "msgpack/versioning.hpp"
|
||||||
|
|
||||||
@@ -45,18 +45,18 @@
|
|||||||
#define MSGPACK_NVP(name, value) (name) (value)
|
#define MSGPACK_NVP(name, value) (name) (value)
|
||||||
|
|
||||||
#define MSGPACK_DEFINE_MAP_EACH_PROC(r, data, elem) \
|
#define MSGPACK_DEFINE_MAP_EACH_PROC(r, data, elem) \
|
||||||
MSGPACK_PP_IF( \
|
BOOST_PP_IF( \
|
||||||
MSGPACK_PP_IS_BEGIN_PARENS(elem), \
|
BOOST_PP_IS_BEGIN_PARENS(elem), \
|
||||||
elem, \
|
elem, \
|
||||||
(MSGPACK_PP_STRINGIZE(elem))(elem) \
|
(BOOST_PP_STRINGIZE(elem))(elem) \
|
||||||
)
|
)
|
||||||
|
|
||||||
#define MSGPACK_DEFINE_MAP_IMPL(...) \
|
#define MSGPACK_DEFINE_MAP_IMPL(...) \
|
||||||
MSGPACK_PP_SEQ_TO_TUPLE( \
|
BOOST_PP_SEQ_TO_TUPLE( \
|
||||||
MSGPACK_PP_SEQ_FOR_EACH( \
|
BOOST_PP_SEQ_FOR_EACH( \
|
||||||
MSGPACK_DEFINE_MAP_EACH_PROC, \
|
MSGPACK_DEFINE_MAP_EACH_PROC, \
|
||||||
0, \
|
0, \
|
||||||
MSGPACK_PP_VARIADIC_TO_SEQ(__VA_ARGS__) \
|
BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__) \
|
||||||
) \
|
) \
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define MSGPACK_BASE_MAP(base) \
|
#define MSGPACK_BASE_MAP(base) \
|
||||||
(MSGPACK_PP_STRINGIZE(base))(*const_cast<base *>(static_cast<base const*>(this)))
|
(BOOST_PP_STRINGIZE(base))(*const_cast<base *>(static_cast<base const*>(this)))
|
||||||
|
|
||||||
// MSGPACK_ADD_ENUM must be used in the global namespace.
|
// MSGPACK_ADD_ENUM must be used in the global namespace.
|
||||||
#define MSGPACK_ADD_ENUM(enum_name) \
|
#define MSGPACK_ADD_ENUM(enum_name) \
|
||||||
|
15
include/msgpack/adaptor/wstring.hpp
Normal file
15
include/msgpack/adaptor/wstring.hpp
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// MessagePack for C++ static resolution routine
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018 KONDO Takatoshi
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
#ifndef MSGPACK_TYPE_WSTRING_HPP
|
||||||
|
#define MSGPACK_TYPE_WSTRING_HPP
|
||||||
|
|
||||||
|
#include "msgpack/v1/adaptor/wstring.hpp"
|
||||||
|
|
||||||
|
#endif // MSGPACK_TYPE_WSTRING_HPP
|
18
include/msgpack/cpp_version.hpp
Normal file
18
include/msgpack/cpp_version.hpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef MSGPACK_CPP_VERSION_HPP
|
||||||
|
#define MSGPACK_CPP_VERSION_HPP
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
# if _MSC_VER < 1900
|
||||||
|
# define MSGPACK_USE_CPP03
|
||||||
|
# endif
|
||||||
|
#elif (__cplusplus < 201103L)
|
||||||
|
# define MSGPACK_USE_CPP03
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_MSVC_LANG)
|
||||||
|
# define MSGPACK_CPP_VERSION _MSVC_LANG
|
||||||
|
#else
|
||||||
|
# define MSGPACK_CPP_VERSION __cplusplus
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // MSGPACK_CPP_VERSION_HPP
|
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* MessagePack for C FILE* buffer adaptor
|
|
||||||
*
|
|
||||||
* Copyright (C) 2013 Vladimir Volodko
|
|
||||||
*
|
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
#ifndef MSGPACK_FBUFFER_H
|
|
||||||
#define MSGPACK_FBUFFER_H
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup msgpack_fbuffer FILE* buffer
|
|
||||||
* @ingroup msgpack_buffer
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
static inline int msgpack_fbuffer_write(void* data, const char* buf, size_t len)
|
|
||||||
{
|
|
||||||
return (len == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @} */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* msgpack/fbuffer.h */
|
|
@@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_GCC_ATOMIC_H
|
|
||||||
#define MSGPACK_GCC_ATOMIC_H
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef int _msgpack_atomic_counter_t;
|
|
||||||
|
|
||||||
int _msgpack_sync_decr_and_fetch(volatile _msgpack_atomic_counter_t* ptr);
|
|
||||||
int _msgpack_sync_incr_and_fetch(volatile _msgpack_atomic_counter_t* ptr);
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif // MSGPACK_GCC_ATOMIC_H
|
|
@@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#if defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41)
|
#if defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41)
|
||||||
|
|
||||||
#include "msgpack/gcc_atomic.h"
|
|
||||||
#include <bits/atomicity.h>
|
#include <bits/atomicity.h>
|
||||||
|
|
||||||
int _msgpack_sync_decr_and_fetch(volatile _msgpack_atomic_counter_t* ptr)
|
int _msgpack_sync_decr_and_fetch(volatile _msgpack_atomic_counter_t* ptr)
|
||||||
|
@@ -1,116 +0,0 @@
|
|||||||
/*
|
|
||||||
* MessagePack for C dynamic typing routine
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
|
||||||
*
|
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
#ifndef MSGPACK_OBJECT_H
|
|
||||||
#define MSGPACK_OBJECT_H
|
|
||||||
|
|
||||||
#include "zone.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup msgpack_object Dynamically typed object
|
|
||||||
* @ingroup msgpack
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
MSGPACK_OBJECT_NIL = 0x00,
|
|
||||||
MSGPACK_OBJECT_BOOLEAN = 0x01,
|
|
||||||
MSGPACK_OBJECT_POSITIVE_INTEGER = 0x02,
|
|
||||||
MSGPACK_OBJECT_NEGATIVE_INTEGER = 0x03,
|
|
||||||
MSGPACK_OBJECT_FLOAT32 = 0x0a,
|
|
||||||
MSGPACK_OBJECT_FLOAT64 = 0x04,
|
|
||||||
MSGPACK_OBJECT_FLOAT = 0x04,
|
|
||||||
#if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT)
|
|
||||||
MSGPACK_OBJECT_DOUBLE = MSGPACK_OBJECT_FLOAT, /* obsolete */
|
|
||||||
#endif /* MSGPACK_USE_LEGACY_NAME_AS_FLOAT */
|
|
||||||
MSGPACK_OBJECT_STR = 0x05,
|
|
||||||
MSGPACK_OBJECT_ARRAY = 0x06,
|
|
||||||
MSGPACK_OBJECT_MAP = 0x07,
|
|
||||||
MSGPACK_OBJECT_BIN = 0x08,
|
|
||||||
MSGPACK_OBJECT_EXT = 0x09
|
|
||||||
} msgpack_object_type;
|
|
||||||
|
|
||||||
|
|
||||||
struct msgpack_object;
|
|
||||||
struct msgpack_object_kv;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint32_t size;
|
|
||||||
struct msgpack_object* ptr;
|
|
||||||
} msgpack_object_array;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint32_t size;
|
|
||||||
struct msgpack_object_kv* ptr;
|
|
||||||
} msgpack_object_map;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint32_t size;
|
|
||||||
const char* ptr;
|
|
||||||
} msgpack_object_str;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint32_t size;
|
|
||||||
const char* ptr;
|
|
||||||
} msgpack_object_bin;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int8_t type;
|
|
||||||
uint32_t size;
|
|
||||||
const char* ptr;
|
|
||||||
} msgpack_object_ext;
|
|
||||||
|
|
||||||
typedef union {
|
|
||||||
bool boolean;
|
|
||||||
uint64_t u64;
|
|
||||||
int64_t i64;
|
|
||||||
#if defined(MSGPACK_USE_LEGACY_NAME_AS_FLOAT)
|
|
||||||
double dec; /* obsolete*/
|
|
||||||
#endif /* MSGPACK_USE_LEGACY_NAME_AS_FLOAT */
|
|
||||||
double f64;
|
|
||||||
msgpack_object_array array;
|
|
||||||
msgpack_object_map map;
|
|
||||||
msgpack_object_str str;
|
|
||||||
msgpack_object_bin bin;
|
|
||||||
msgpack_object_ext ext;
|
|
||||||
} msgpack_object_union;
|
|
||||||
|
|
||||||
typedef struct msgpack_object {
|
|
||||||
msgpack_object_type type;
|
|
||||||
msgpack_object_union via;
|
|
||||||
} msgpack_object;
|
|
||||||
|
|
||||||
typedef struct msgpack_object_kv {
|
|
||||||
msgpack_object key;
|
|
||||||
msgpack_object val;
|
|
||||||
} msgpack_object_kv;
|
|
||||||
|
|
||||||
MSGPACK_DLLEXPORT
|
|
||||||
void msgpack_object_print(FILE* out, msgpack_object o);
|
|
||||||
|
|
||||||
MSGPACK_DLLEXPORT
|
|
||||||
int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o);
|
|
||||||
|
|
||||||
MSGPACK_DLLEXPORT
|
|
||||||
bool msgpack_object_equal(const msgpack_object x, const msgpack_object y);
|
|
||||||
|
|
||||||
/** @} */
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* msgpack/object.h */
|
|
@@ -1,151 +0,0 @@
|
|||||||
/*
|
|
||||||
* MessagePack for C packing routine
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
|
|
||||||
*
|
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
#ifndef MSGPACK_PACK_H
|
|
||||||
#define MSGPACK_PACK_H
|
|
||||||
|
|
||||||
#include "pack_define.h"
|
|
||||||
#include "object.h"
|
|
||||||
#include "timestamp.h"
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup msgpack_buffer Buffers
|
|
||||||
* @ingroup msgpack
|
|
||||||
* @{
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup msgpack_pack Serializer
|
|
||||||
* @ingroup msgpack
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef int (*msgpack_packer_write)(void* data, const char* buf, size_t len);
|
|
||||||
|
|
||||||
typedef struct msgpack_packer {
|
|
||||||
void* data;
|
|
||||||
msgpack_packer_write callback;
|
|
||||||
} msgpack_packer;
|
|
||||||
|
|
||||||
static void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback);
|
|
||||||
|
|
||||||
static msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback);
|
|
||||||
static void msgpack_packer_free(msgpack_packer* pk);
|
|
||||||
|
|
||||||
static int msgpack_pack_char(msgpack_packer* pk, char d);
|
|
||||||
|
|
||||||
static int msgpack_pack_signed_char(msgpack_packer* pk, signed char d);
|
|
||||||
static int msgpack_pack_short(msgpack_packer* pk, short d);
|
|
||||||
static int msgpack_pack_int(msgpack_packer* pk, int d);
|
|
||||||
static int msgpack_pack_long(msgpack_packer* pk, long d);
|
|
||||||
static int msgpack_pack_long_long(msgpack_packer* pk, long long d);
|
|
||||||
static int msgpack_pack_unsigned_char(msgpack_packer* pk, unsigned char d);
|
|
||||||
static int msgpack_pack_unsigned_short(msgpack_packer* pk, unsigned short d);
|
|
||||||
static int msgpack_pack_unsigned_int(msgpack_packer* pk, unsigned int d);
|
|
||||||
static int msgpack_pack_unsigned_long(msgpack_packer* pk, unsigned long d);
|
|
||||||
static int msgpack_pack_unsigned_long_long(msgpack_packer* pk, unsigned long long d);
|
|
||||||
|
|
||||||
static int msgpack_pack_uint8(msgpack_packer* pk, uint8_t d);
|
|
||||||
static int msgpack_pack_uint16(msgpack_packer* pk, uint16_t d);
|
|
||||||
static int msgpack_pack_uint32(msgpack_packer* pk, uint32_t d);
|
|
||||||
static int msgpack_pack_uint64(msgpack_packer* pk, uint64_t d);
|
|
||||||
static int msgpack_pack_int8(msgpack_packer* pk, int8_t d);
|
|
||||||
static int msgpack_pack_int16(msgpack_packer* pk, int16_t d);
|
|
||||||
static int msgpack_pack_int32(msgpack_packer* pk, int32_t d);
|
|
||||||
static int msgpack_pack_int64(msgpack_packer* pk, int64_t d);
|
|
||||||
|
|
||||||
static int msgpack_pack_fix_uint8(msgpack_packer* pk, uint8_t d);
|
|
||||||
static int msgpack_pack_fix_uint16(msgpack_packer* pk, uint16_t d);
|
|
||||||
static int msgpack_pack_fix_uint32(msgpack_packer* pk, uint32_t d);
|
|
||||||
static int msgpack_pack_fix_uint64(msgpack_packer* pk, uint64_t d);
|
|
||||||
static int msgpack_pack_fix_int8(msgpack_packer* pk, int8_t d);
|
|
||||||
static int msgpack_pack_fix_int16(msgpack_packer* pk, int16_t d);
|
|
||||||
static int msgpack_pack_fix_int32(msgpack_packer* pk, int32_t d);
|
|
||||||
static int msgpack_pack_fix_int64(msgpack_packer* pk, int64_t d);
|
|
||||||
|
|
||||||
static int msgpack_pack_float(msgpack_packer* pk, float d);
|
|
||||||
static int msgpack_pack_double(msgpack_packer* pk, double d);
|
|
||||||
|
|
||||||
static int msgpack_pack_nil(msgpack_packer* pk);
|
|
||||||
static int msgpack_pack_true(msgpack_packer* pk);
|
|
||||||
static int msgpack_pack_false(msgpack_packer* pk);
|
|
||||||
|
|
||||||
static int msgpack_pack_array(msgpack_packer* pk, size_t n);
|
|
||||||
|
|
||||||
static int msgpack_pack_map(msgpack_packer* pk, size_t n);
|
|
||||||
|
|
||||||
static int msgpack_pack_str(msgpack_packer* pk, size_t l);
|
|
||||||
static int msgpack_pack_str_body(msgpack_packer* pk, const void* b, size_t l);
|
|
||||||
|
|
||||||
static int msgpack_pack_v4raw(msgpack_packer* pk, size_t l);
|
|
||||||
static int msgpack_pack_v4raw_body(msgpack_packer* pk, const void* b, size_t l);
|
|
||||||
|
|
||||||
static int msgpack_pack_bin(msgpack_packer* pk, size_t l);
|
|
||||||
static int msgpack_pack_bin_body(msgpack_packer* pk, const void* b, size_t l);
|
|
||||||
|
|
||||||
static int msgpack_pack_ext(msgpack_packer* pk, size_t l, int8_t type);
|
|
||||||
static int msgpack_pack_ext_body(msgpack_packer* pk, const void* b, size_t l);
|
|
||||||
|
|
||||||
static int msgpack_pack_timestamp(msgpack_packer* pk, const msgpack_timestamp* d);
|
|
||||||
|
|
||||||
MSGPACK_DLLEXPORT
|
|
||||||
int msgpack_pack_object(msgpack_packer* pk, msgpack_object d);
|
|
||||||
|
|
||||||
|
|
||||||
/** @} */
|
|
||||||
|
|
||||||
|
|
||||||
#define msgpack_pack_inline_func(name) \
|
|
||||||
inline int msgpack_pack ## name
|
|
||||||
|
|
||||||
#define msgpack_pack_inline_func_cint(name) \
|
|
||||||
inline int msgpack_pack ## name
|
|
||||||
|
|
||||||
#define msgpack_pack_inline_func_fixint(name) \
|
|
||||||
inline int msgpack_pack_fix ## name
|
|
||||||
|
|
||||||
#define msgpack_pack_user msgpack_packer*
|
|
||||||
|
|
||||||
#define msgpack_pack_append_buffer(user, buf, len) \
|
|
||||||
return (*(user)->callback)((user)->data, (const char*)buf, len)
|
|
||||||
|
|
||||||
#include "pack_template.h"
|
|
||||||
|
|
||||||
inline void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback)
|
|
||||||
{
|
|
||||||
pk->data = data;
|
|
||||||
pk->callback = callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback)
|
|
||||||
{
|
|
||||||
msgpack_packer* pk = (msgpack_packer*)calloc(1, sizeof(msgpack_packer));
|
|
||||||
if(!pk) { return NULL; }
|
|
||||||
msgpack_packer_init(pk, data, callback);
|
|
||||||
return pk;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void msgpack_packer_free(msgpack_packer* pk)
|
|
||||||
{
|
|
||||||
free(pk);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* msgpack/pack.h */
|
|
@@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
* MessagePack unpacking routine template
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
|
||||||
*
|
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
#ifndef MSGPACK_PACK_DEFINE_H
|
|
||||||
#define MSGPACK_PACK_DEFINE_H
|
|
||||||
|
|
||||||
#include "msgpack/sysdep.h"
|
|
||||||
#include <limits.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#endif /* msgpack/pack_define.h */
|
|
||||||
|
|
@@ -1,937 +0,0 @@
|
|||||||
/*
|
|
||||||
* MessagePack packing routine template
|
|
||||||
*
|
|
||||||
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
|
|
||||||
*
|
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if MSGPACK_ENDIAN_LITTLE_BYTE
|
|
||||||
#define TAKE8_8(d) ((uint8_t*)&d)[0]
|
|
||||||
#define TAKE8_16(d) ((uint8_t*)&d)[0]
|
|
||||||
#define TAKE8_32(d) ((uint8_t*)&d)[0]
|
|
||||||
#define TAKE8_64(d) ((uint8_t*)&d)[0]
|
|
||||||
#elif MSGPACK_ENDIAN_BIG_BYTE
|
|
||||||
#define TAKE8_8(d) ((uint8_t*)&d)[0]
|
|
||||||
#define TAKE8_16(d) ((uint8_t*)&d)[1]
|
|
||||||
#define TAKE8_32(d) ((uint8_t*)&d)[3]
|
|
||||||
#define TAKE8_64(d) ((uint8_t*)&d)[7]
|
|
||||||
#else
|
|
||||||
#error msgpack-c supports only big endian and little endian
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef msgpack_pack_inline_func
|
|
||||||
#error msgpack_pack_inline_func template is not defined
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef msgpack_pack_user
|
|
||||||
#error msgpack_pack_user type is not defined
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef msgpack_pack_append_buffer
|
|
||||||
#error msgpack_pack_append_buffer callback is not defined
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Integer
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define msgpack_pack_real_uint8(x, d) \
|
|
||||||
do { \
|
|
||||||
if(d < (1<<7)) { \
|
|
||||||
/* fixnum */ \
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 8 */ \
|
|
||||||
unsigned char buf[2] = {0xcc, TAKE8_8(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define msgpack_pack_real_uint16(x, d) \
|
|
||||||
do { \
|
|
||||||
if(d < (1<<7)) { \
|
|
||||||
/* fixnum */ \
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_16(d), 1); \
|
|
||||||
} else if(d < (1<<8)) { \
|
|
||||||
/* unsigned 8 */ \
|
|
||||||
unsigned char buf[2] = {0xcc, TAKE8_16(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 16 */ \
|
|
||||||
unsigned char buf[3]; \
|
|
||||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3); \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define msgpack_pack_real_uint32(x, d) \
|
|
||||||
do { \
|
|
||||||
if(d < (1<<8)) { \
|
|
||||||
if(d < (1<<7)) { \
|
|
||||||
/* fixnum */ \
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_32(d), 1); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 8 */ \
|
|
||||||
unsigned char buf[2] = {0xcc, TAKE8_32(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} \
|
|
||||||
} else { \
|
|
||||||
if(d < (1<<16)) { \
|
|
||||||
/* unsigned 16 */ \
|
|
||||||
unsigned char buf[3]; \
|
|
||||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 32 */ \
|
|
||||||
unsigned char buf[5]; \
|
|
||||||
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define msgpack_pack_real_uint64(x, d) \
|
|
||||||
do { \
|
|
||||||
if(d < (1ULL<<8)) { \
|
|
||||||
if(d < (1ULL<<7)) { \
|
|
||||||
/* fixnum */ \
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_64(d), 1); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 8 */ \
|
|
||||||
unsigned char buf[2] = {0xcc, TAKE8_64(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} \
|
|
||||||
} else { \
|
|
||||||
if(d < (1ULL<<16)) { \
|
|
||||||
/* unsigned 16 */ \
|
|
||||||
unsigned char buf[3]; \
|
|
||||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3); \
|
|
||||||
} else if(d < (1ULL<<32)) { \
|
|
||||||
/* unsigned 32 */ \
|
|
||||||
unsigned char buf[5]; \
|
|
||||||
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 64 */ \
|
|
||||||
unsigned char buf[9]; \
|
|
||||||
buf[0] = 0xcf; _msgpack_store64(&buf[1], d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 9); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define msgpack_pack_real_int8(x, d) \
|
|
||||||
do { \
|
|
||||||
if(d < -(1<<5)) { \
|
|
||||||
/* signed 8 */ \
|
|
||||||
unsigned char buf[2] = {0xd0, TAKE8_8(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} else { \
|
|
||||||
/* fixnum */ \
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1); \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define msgpack_pack_real_int16(x, d) \
|
|
||||||
do { \
|
|
||||||
if(d < -(1<<5)) { \
|
|
||||||
if(d < -(1<<7)) { \
|
|
||||||
/* signed 16 */ \
|
|
||||||
unsigned char buf[3]; \
|
|
||||||
buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3); \
|
|
||||||
} else { \
|
|
||||||
/* signed 8 */ \
|
|
||||||
unsigned char buf[2] = {0xd0, TAKE8_16(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} \
|
|
||||||
} else if(d < (1<<7)) { \
|
|
||||||
/* fixnum */ \
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_16(d), 1); \
|
|
||||||
} else { \
|
|
||||||
if(d < (1<<8)) { \
|
|
||||||
/* unsigned 8 */ \
|
|
||||||
unsigned char buf[2] = {0xcc, TAKE8_16(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 16 */ \
|
|
||||||
unsigned char buf[3]; \
|
|
||||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define msgpack_pack_real_int32(x, d) \
|
|
||||||
do { \
|
|
||||||
if(d < -(1<<5)) { \
|
|
||||||
if(d < -(1<<15)) { \
|
|
||||||
/* signed 32 */ \
|
|
||||||
unsigned char buf[5]; \
|
|
||||||
buf[0] = 0xd2; _msgpack_store32(&buf[1], (int32_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5); \
|
|
||||||
} else if(d < -(1<<7)) { \
|
|
||||||
/* signed 16 */ \
|
|
||||||
unsigned char buf[3]; \
|
|
||||||
buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3); \
|
|
||||||
} else { \
|
|
||||||
/* signed 8 */ \
|
|
||||||
unsigned char buf[2] = {0xd0, TAKE8_32(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} \
|
|
||||||
} else if(d < (1<<7)) { \
|
|
||||||
/* fixnum */ \
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_32(d), 1); \
|
|
||||||
} else { \
|
|
||||||
if(d < (1<<8)) { \
|
|
||||||
/* unsigned 8 */ \
|
|
||||||
unsigned char buf[2] = {0xcc, TAKE8_32(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} else if(d < (1<<16)) { \
|
|
||||||
/* unsigned 16 */ \
|
|
||||||
unsigned char buf[3]; \
|
|
||||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 32 */ \
|
|
||||||
unsigned char buf[5]; \
|
|
||||||
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define msgpack_pack_real_int64(x, d) \
|
|
||||||
do { \
|
|
||||||
if(d < -(1LL<<5)) { \
|
|
||||||
if(d < -(1LL<<15)) { \
|
|
||||||
if(d < -(1LL<<31)) { \
|
|
||||||
/* signed 64 */ \
|
|
||||||
unsigned char buf[9]; \
|
|
||||||
buf[0] = 0xd3; _msgpack_store64(&buf[1], d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 9); \
|
|
||||||
} else { \
|
|
||||||
/* signed 32 */ \
|
|
||||||
unsigned char buf[5]; \
|
|
||||||
buf[0] = 0xd2; _msgpack_store32(&buf[1], (int32_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5); \
|
|
||||||
} \
|
|
||||||
} else { \
|
|
||||||
if(d < -(1<<7)) { \
|
|
||||||
/* signed 16 */ \
|
|
||||||
unsigned char buf[3]; \
|
|
||||||
buf[0] = 0xd1; _msgpack_store16(&buf[1], (int16_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3); \
|
|
||||||
} else { \
|
|
||||||
/* signed 8 */ \
|
|
||||||
unsigned char buf[2] = {0xd0, TAKE8_64(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} else if(d < (1<<7)) { \
|
|
||||||
/* fixnum */ \
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_64(d), 1); \
|
|
||||||
} else { \
|
|
||||||
if(d < (1LL<<16)) { \
|
|
||||||
if(d < (1<<8)) { \
|
|
||||||
/* unsigned 8 */ \
|
|
||||||
unsigned char buf[2] = {0xcc, TAKE8_64(d)}; \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 16 */ \
|
|
||||||
unsigned char buf[3]; \
|
|
||||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], (uint16_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3); \
|
|
||||||
} \
|
|
||||||
} else { \
|
|
||||||
if(d < (1LL<<32)) { \
|
|
||||||
/* unsigned 32 */ \
|
|
||||||
unsigned char buf[5]; \
|
|
||||||
buf[0] = 0xce; _msgpack_store32(&buf[1], (uint32_t)d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5); \
|
|
||||||
} else { \
|
|
||||||
/* unsigned 64 */ \
|
|
||||||
unsigned char buf[9]; \
|
|
||||||
buf[0] = 0xcf; _msgpack_store64(&buf[1], d); \
|
|
||||||
msgpack_pack_append_buffer(x, buf, 9); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef msgpack_pack_inline_func_fixint
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_fixint(_uint8)(msgpack_pack_user x, uint8_t d)
|
|
||||||
{
|
|
||||||
unsigned char buf[2] = {0xcc, TAKE8_8(d)};
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_fixint(_uint16)(msgpack_pack_user x, uint16_t d)
|
|
||||||
{
|
|
||||||
unsigned char buf[3];
|
|
||||||
buf[0] = 0xcd; _msgpack_store16(&buf[1], d);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_fixint(_uint32)(msgpack_pack_user x, uint32_t d)
|
|
||||||
{
|
|
||||||
unsigned char buf[5];
|
|
||||||
buf[0] = 0xce; _msgpack_store32(&buf[1], d);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_fixint(_uint64)(msgpack_pack_user x, uint64_t d)
|
|
||||||
{
|
|
||||||
unsigned char buf[9];
|
|
||||||
buf[0] = 0xcf; _msgpack_store64(&buf[1], d);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_fixint(_int8)(msgpack_pack_user x, int8_t d)
|
|
||||||
{
|
|
||||||
unsigned char buf[2] = {0xd0, TAKE8_8(d)};
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_fixint(_int16)(msgpack_pack_user x, int16_t d)
|
|
||||||
{
|
|
||||||
unsigned char buf[3];
|
|
||||||
buf[0] = 0xd1; _msgpack_store16(&buf[1], d);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_fixint(_int32)(msgpack_pack_user x, int32_t d)
|
|
||||||
{
|
|
||||||
unsigned char buf[5];
|
|
||||||
buf[0] = 0xd2; _msgpack_store32(&buf[1], d);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_fixint(_int64)(msgpack_pack_user x, int64_t d)
|
|
||||||
{
|
|
||||||
unsigned char buf[9];
|
|
||||||
buf[0] = 0xd3; _msgpack_store64(&buf[1], d);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef msgpack_pack_inline_func_fixint
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_uint8)(msgpack_pack_user x, uint8_t d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_uint8(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_uint16)(msgpack_pack_user x, uint16_t d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_uint32)(msgpack_pack_user x, uint32_t d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_uint64)(msgpack_pack_user x, uint64_t d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_int8)(msgpack_pack_user x, int8_t d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_int8(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_int16)(msgpack_pack_user x, int16_t d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_int32)(msgpack_pack_user x, int32_t d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_int64)(msgpack_pack_user x, int64_t d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_char)(msgpack_pack_user x, char d)
|
|
||||||
{
|
|
||||||
#if defined(CHAR_MIN)
|
|
||||||
#if CHAR_MIN < 0
|
|
||||||
msgpack_pack_real_int8(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_uint8(x, d);
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#error CHAR_MIN is not defined
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_signed_char)(msgpack_pack_user x, signed char d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_int8(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_unsigned_char)(msgpack_pack_user x, unsigned char d)
|
|
||||||
{
|
|
||||||
msgpack_pack_real_uint8(x, d);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef msgpack_pack_inline_func_cint
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_cint(_short)(msgpack_pack_user x, short d)
|
|
||||||
{
|
|
||||||
#if defined(SIZEOF_SHORT)
|
|
||||||
#if SIZEOF_SHORT == 2
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
#elif SIZEOF_SHORT == 4
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(SHRT_MAX)
|
|
||||||
#if SHRT_MAX == 0x7fff
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
#elif SHRT_MAX == 0x7fffffff
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
if(sizeof(short) == 2) {
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
} else if(sizeof(short) == 4) {
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
} else {
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_cint(_int)(msgpack_pack_user x, int d)
|
|
||||||
{
|
|
||||||
#if defined(SIZEOF_INT)
|
|
||||||
#if SIZEOF_INT == 2
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
#elif SIZEOF_INT == 4
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(INT_MAX)
|
|
||||||
#if INT_MAX == 0x7fff
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
#elif INT_MAX == 0x7fffffff
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
if(sizeof(int) == 2) {
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
} else if(sizeof(int) == 4) {
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
} else {
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_cint(_long)(msgpack_pack_user x, long d)
|
|
||||||
{
|
|
||||||
#if defined(SIZEOF_LONG)
|
|
||||||
#if SIZEOF_LONG == 2
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
#elif SIZEOF_LONG == 4
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(LONG_MAX)
|
|
||||||
#if LONG_MAX == 0x7fffL
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
#elif LONG_MAX == 0x7fffffffL
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
if(sizeof(long) == 2) {
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
} else if(sizeof(long) == 4) {
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
} else {
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_cint(_long_long)(msgpack_pack_user x, long long d)
|
|
||||||
{
|
|
||||||
#if defined(SIZEOF_LONG_LONG)
|
|
||||||
#if SIZEOF_LONG_LONG == 2
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
#elif SIZEOF_LONG_LONG == 4
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(LLONG_MAX)
|
|
||||||
#if LLONG_MAX == 0x7fffL
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
#elif LLONG_MAX == 0x7fffffffL
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
if(sizeof(long long) == 2) {
|
|
||||||
msgpack_pack_real_int16(x, d);
|
|
||||||
} else if(sizeof(long long) == 4) {
|
|
||||||
msgpack_pack_real_int32(x, d);
|
|
||||||
} else {
|
|
||||||
msgpack_pack_real_int64(x, d);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_cint(_unsigned_short)(msgpack_pack_user x, unsigned short d)
|
|
||||||
{
|
|
||||||
#if defined(SIZEOF_SHORT)
|
|
||||||
#if SIZEOF_SHORT == 2
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
#elif SIZEOF_SHORT == 4
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(USHRT_MAX)
|
|
||||||
#if USHRT_MAX == 0xffffU
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
#elif USHRT_MAX == 0xffffffffU
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
if(sizeof(unsigned short) == 2) {
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
} else if(sizeof(unsigned short) == 4) {
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
} else {
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_cint(_unsigned_int)(msgpack_pack_user x, unsigned int d)
|
|
||||||
{
|
|
||||||
#if defined(SIZEOF_INT)
|
|
||||||
#if SIZEOF_INT == 2
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
#elif SIZEOF_INT == 4
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(UINT_MAX)
|
|
||||||
#if UINT_MAX == 0xffffU
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
#elif UINT_MAX == 0xffffffffU
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
if(sizeof(unsigned int) == 2) {
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
} else if(sizeof(unsigned int) == 4) {
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
} else {
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_cint(_unsigned_long)(msgpack_pack_user x, unsigned long d)
|
|
||||||
{
|
|
||||||
#if defined(SIZEOF_LONG)
|
|
||||||
#if SIZEOF_LONG == 2
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
#elif SIZEOF_LONG == 4
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(ULONG_MAX)
|
|
||||||
#if ULONG_MAX == 0xffffUL
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
#elif ULONG_MAX == 0xffffffffUL
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
if(sizeof(unsigned long) == 2) {
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
} else if(sizeof(unsigned long) == 4) {
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
} else {
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func_cint(_unsigned_long_long)(msgpack_pack_user x, unsigned long long d)
|
|
||||||
{
|
|
||||||
#if defined(SIZEOF_LONG_LONG)
|
|
||||||
#if SIZEOF_LONG_LONG == 2
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
#elif SIZEOF_LONG_LONG == 4
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#elif defined(ULLONG_MAX)
|
|
||||||
#if ULLONG_MAX == 0xffffUL
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
#elif ULLONG_MAX == 0xffffffffUL
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
#else
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
if(sizeof(unsigned long long) == 2) {
|
|
||||||
msgpack_pack_real_uint16(x, d);
|
|
||||||
} else if(sizeof(unsigned long long) == 4) {
|
|
||||||
msgpack_pack_real_uint32(x, d);
|
|
||||||
} else {
|
|
||||||
msgpack_pack_real_uint64(x, d);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef msgpack_pack_inline_func_cint
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Float
|
|
||||||
*/
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_float)(msgpack_pack_user x, float d)
|
|
||||||
{
|
|
||||||
unsigned char buf[5];
|
|
||||||
union { float f; uint32_t i; } mem;
|
|
||||||
mem.f = d;
|
|
||||||
buf[0] = 0xca; _msgpack_store32(&buf[1], mem.i);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_double)(msgpack_pack_user x, double d)
|
|
||||||
{
|
|
||||||
unsigned char buf[9];
|
|
||||||
union { double f; uint64_t i; } mem;
|
|
||||||
mem.f = d;
|
|
||||||
buf[0] = 0xcb;
|
|
||||||
#if defined(TARGET_OS_IPHONE)
|
|
||||||
// ok
|
|
||||||
#elif defined(__arm__) && !(__ARM_EABI__) // arm-oabi
|
|
||||||
// https://github.com/msgpack/msgpack-perl/pull/1
|
|
||||||
mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
|
|
||||||
#endif
|
|
||||||
_msgpack_store64(&buf[1], mem.i);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 9);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Nil
|
|
||||||
*/
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_nil)(msgpack_pack_user x)
|
|
||||||
{
|
|
||||||
static const unsigned char d = 0xc0;
|
|
||||||
msgpack_pack_append_buffer(x, &d, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Boolean
|
|
||||||
*/
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_true)(msgpack_pack_user x)
|
|
||||||
{
|
|
||||||
static const unsigned char d = 0xc3;
|
|
||||||
msgpack_pack_append_buffer(x, &d, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_false)(msgpack_pack_user x)
|
|
||||||
{
|
|
||||||
static const unsigned char d = 0xc2;
|
|
||||||
msgpack_pack_append_buffer(x, &d, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Array
|
|
||||||
*/
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_array)(msgpack_pack_user x, size_t n)
|
|
||||||
{
|
|
||||||
if(n < 16) {
|
|
||||||
unsigned char d = 0x90 | (uint8_t)n;
|
|
||||||
msgpack_pack_append_buffer(x, &d, 1);
|
|
||||||
} else if(n < 65536) {
|
|
||||||
unsigned char buf[3];
|
|
||||||
buf[0] = 0xdc; _msgpack_store16(&buf[1], (uint16_t)n);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3);
|
|
||||||
} else {
|
|
||||||
unsigned char buf[5];
|
|
||||||
buf[0] = 0xdd; _msgpack_store32(&buf[1], (uint32_t)n);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Map
|
|
||||||
*/
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_map)(msgpack_pack_user x, size_t n)
|
|
||||||
{
|
|
||||||
if(n < 16) {
|
|
||||||
unsigned char d = 0x80 | (uint8_t)n;
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1);
|
|
||||||
} else if(n < 65536) {
|
|
||||||
unsigned char buf[3];
|
|
||||||
buf[0] = 0xde; _msgpack_store16(&buf[1], (uint16_t)n);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3);
|
|
||||||
} else {
|
|
||||||
unsigned char buf[5];
|
|
||||||
buf[0] = 0xdf; _msgpack_store32(&buf[1], (uint32_t)n);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Str
|
|
||||||
*/
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_str)(msgpack_pack_user x, size_t l)
|
|
||||||
{
|
|
||||||
if(l < 32) {
|
|
||||||
unsigned char d = 0xa0 | (uint8_t)l;
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1);
|
|
||||||
} else if(l < 256) {
|
|
||||||
unsigned char buf[2];
|
|
||||||
buf[0] = 0xd9; buf[1] = (uint8_t)l;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2);
|
|
||||||
} else if(l < 65536) {
|
|
||||||
unsigned char buf[3];
|
|
||||||
buf[0] = 0xda; _msgpack_store16(&buf[1], (uint16_t)l);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3);
|
|
||||||
} else {
|
|
||||||
unsigned char buf[5];
|
|
||||||
buf[0] = 0xdb; _msgpack_store32(&buf[1], (uint32_t)l);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_str_body)(msgpack_pack_user x, const void* b, size_t l)
|
|
||||||
{
|
|
||||||
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Raw (V4)
|
|
||||||
*/
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_v4raw)(msgpack_pack_user x, size_t l)
|
|
||||||
{
|
|
||||||
if(l < 32) {
|
|
||||||
unsigned char d = 0xa0 | (uint8_t)l;
|
|
||||||
msgpack_pack_append_buffer(x, &TAKE8_8(d), 1);
|
|
||||||
} else if(l < 65536) {
|
|
||||||
unsigned char buf[3];
|
|
||||||
buf[0] = 0xda; _msgpack_store16(&buf[1], (uint16_t)l);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3);
|
|
||||||
} else {
|
|
||||||
unsigned char buf[5];
|
|
||||||
buf[0] = 0xdb; _msgpack_store32(&buf[1], (uint32_t)l);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_v4raw_body)(msgpack_pack_user x, const void* b, size_t l)
|
|
||||||
{
|
|
||||||
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Bin
|
|
||||||
*/
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_bin)(msgpack_pack_user x, size_t l)
|
|
||||||
{
|
|
||||||
if(l < 256) {
|
|
||||||
unsigned char buf[2];
|
|
||||||
buf[0] = 0xc4; buf[1] = (uint8_t)l;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2);
|
|
||||||
} else if(l < 65536) {
|
|
||||||
unsigned char buf[3];
|
|
||||||
buf[0] = 0xc5; _msgpack_store16(&buf[1], (uint16_t)l);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3);
|
|
||||||
} else {
|
|
||||||
unsigned char buf[5];
|
|
||||||
buf[0] = 0xc6; _msgpack_store32(&buf[1], (uint32_t)l);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_bin_body)(msgpack_pack_user x, const void* b, size_t l)
|
|
||||||
{
|
|
||||||
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Ext
|
|
||||||
*/
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_ext)(msgpack_pack_user x, size_t l, int8_t type)
|
|
||||||
{
|
|
||||||
switch(l) {
|
|
||||||
case 1: {
|
|
||||||
unsigned char buf[2];
|
|
||||||
buf[0] = 0xd4;
|
|
||||||
buf[1] = type;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2);
|
|
||||||
} break;
|
|
||||||
case 2: {
|
|
||||||
unsigned char buf[2];
|
|
||||||
buf[0] = 0xd5;
|
|
||||||
buf[1] = type;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2);
|
|
||||||
} break;
|
|
||||||
case 4: {
|
|
||||||
unsigned char buf[2];
|
|
||||||
buf[0] = 0xd6;
|
|
||||||
buf[1] = type;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2);
|
|
||||||
} break;
|
|
||||||
case 8: {
|
|
||||||
unsigned char buf[2];
|
|
||||||
buf[0] = 0xd7;
|
|
||||||
buf[1] = type;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2);
|
|
||||||
} break;
|
|
||||||
case 16: {
|
|
||||||
unsigned char buf[2];
|
|
||||||
buf[0] = 0xd8;
|
|
||||||
buf[1] = type;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 2);
|
|
||||||
} break;
|
|
||||||
default:
|
|
||||||
if(l < 256) {
|
|
||||||
unsigned char buf[3];
|
|
||||||
buf[0] = 0xc7;
|
|
||||||
buf[1] = (unsigned char)l;
|
|
||||||
buf[2] = type;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 3);
|
|
||||||
} else if(l < 65536) {
|
|
||||||
unsigned char buf[4];
|
|
||||||
buf[0] = 0xc8;
|
|
||||||
_msgpack_store16(&buf[1], l);
|
|
||||||
buf[3] = type;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 4);
|
|
||||||
} else {
|
|
||||||
unsigned char buf[6];
|
|
||||||
buf[0] = 0xc9;
|
|
||||||
_msgpack_store32(&buf[1], l);
|
|
||||||
buf[5] = type;
|
|
||||||
msgpack_pack_append_buffer(x, buf, 6);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_ext_body)(msgpack_pack_user x, const void* b, size_t l)
|
|
||||||
{
|
|
||||||
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
|
|
||||||
}
|
|
||||||
|
|
||||||
msgpack_pack_inline_func(_timestamp)(msgpack_pack_user x, const msgpack_timestamp* d)
|
|
||||||
{
|
|
||||||
if ((((int64_t)d->tv_sec) >> 34) == 0) {
|
|
||||||
uint64_t data64 = ((uint64_t) d->tv_nsec << 34) | d->tv_sec;
|
|
||||||
if ((data64 & 0xffffffff00000000L) == 0) {
|
|
||||||
// timestamp 32
|
|
||||||
char buf[4];
|
|
||||||
uint32_t data32 = (uint32_t)data64;
|
|
||||||
msgpack_pack_ext(x, 4, -1);
|
|
||||||
_msgpack_store32(buf, data32);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 4);
|
|
||||||
} else {
|
|
||||||
// timestamp 64
|
|
||||||
char buf[8];
|
|
||||||
msgpack_pack_ext(x, 8, -1);
|
|
||||||
_msgpack_store64(buf, data64);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 8);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// timestamp 96
|
|
||||||
char buf[12];
|
|
||||||
_msgpack_store32(&buf[0], d->tv_nsec);
|
|
||||||
_msgpack_store64(&buf[4], d->tv_sec);
|
|
||||||
msgpack_pack_ext(x, 12, -1);
|
|
||||||
msgpack_pack_append_buffer(x, buf, 12);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef msgpack_pack_inline_func
|
|
||||||
#undef msgpack_pack_user
|
|
||||||
#undef msgpack_pack_append_buffer
|
|
||||||
|
|
||||||
#undef TAKE8_8
|
|
||||||
#undef TAKE8_16
|
|
||||||
#undef TAKE8_32
|
|
||||||
#undef TAKE8_64
|
|
||||||
|
|
||||||
#undef msgpack_pack_real_uint8
|
|
||||||
#undef msgpack_pack_real_uint16
|
|
||||||
#undef msgpack_pack_real_uint32
|
|
||||||
#undef msgpack_pack_real_uint64
|
|
||||||
#undef msgpack_pack_real_int8
|
|
||||||
#undef msgpack_pack_real_int16
|
|
||||||
#undef msgpack_pack_real_int32
|
|
||||||
#undef msgpack_pack_real_int64
|
|
@@ -1,24 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(MSGPACK_PREDEF_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS)
|
|
||||||
#ifndef MSGPACK_PREDEF_H
|
|
||||||
#define MSGPACK_PREDEF_H
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/language.h>
|
|
||||||
#include <msgpack/predef/architecture.h>
|
|
||||||
#include <msgpack/predef/compiler.h>
|
|
||||||
#include <msgpack/predef/library.h>
|
|
||||||
#include <msgpack/predef/os.h>
|
|
||||||
#include <msgpack/predef/other.h>
|
|
||||||
#include <msgpack/predef/platform.h>
|
|
||||||
#include <msgpack/predef/hardware.h>
|
|
||||||
|
|
||||||
#include <msgpack/predef/version.h>
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(MSGPACK_PREDEF_ARCHITECTURE_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS)
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_H
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/architecture/alpha.h>
|
|
||||||
#include <msgpack/predef/architecture/arm.h>
|
|
||||||
#include <msgpack/predef/architecture/blackfin.h>
|
|
||||||
#include <msgpack/predef/architecture/convex.h>
|
|
||||||
#include <msgpack/predef/architecture/ia64.h>
|
|
||||||
#include <msgpack/predef/architecture/m68k.h>
|
|
||||||
#include <msgpack/predef/architecture/mips.h>
|
|
||||||
#include <msgpack/predef/architecture/parisc.h>
|
|
||||||
#include <msgpack/predef/architecture/ppc.h>
|
|
||||||
#include <msgpack/predef/architecture/pyramid.h>
|
|
||||||
#include <msgpack/predef/architecture/rs6k.h>
|
|
||||||
#include <msgpack/predef/architecture/sparc.h>
|
|
||||||
#include <msgpack/predef/architecture/superh.h>
|
|
||||||
#include <msgpack/predef/architecture/sys370.h>
|
|
||||||
#include <msgpack/predef/architecture/sys390.h>
|
|
||||||
#include <msgpack/predef/architecture/x86.h>
|
|
||||||
#include <msgpack/predef/architecture/z.h>
|
|
||||||
/*#include <msgpack/predef/architecture/.h>*/
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_ALPHA_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_ALPHA_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_ALPHA`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/DEC_Alpha DEC Alpha] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
[[`__alpha__`] [__predef_detection__]]
|
|
||||||
[[`__alpha`] [__predef_detection__]]
|
|
||||||
[[`_M_ALPHA`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__alpha_ev4__`] [4.0.0]]
|
|
||||||
[[`__alpha_ev5__`] [5.0.0]]
|
|
||||||
[[`__alpha_ev6__`] [6.0.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__alpha__) || defined(__alpha) || \
|
|
||||||
defined(_M_ALPHA)
|
|
||||||
# undef MSGPACK_ARCH_ALPHA
|
|
||||||
# if !defined(MSGPACK_ARCH_ALPHA) && defined(__alpha_ev4__)
|
|
||||||
# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER(4,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_ALPHA) && defined(__alpha_ev5__)
|
|
||||||
# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER(5,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_ALPHA) && defined(__alpha_ev6__)
|
|
||||||
# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER(6,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_ALPHA)
|
|
||||||
# define MSGPACK_ARCH_ALPHA MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_ALPHA
|
|
||||||
# define MSGPACK_ARCH_ALPHA_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_ALPHA_NAME "DEC Alpha"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_ALPHA,MSGPACK_ARCH_ALPHA_NAME)
|
|
@@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Copyright Franz Detro 2014
|
|
||||||
Copyright (c) Microsoft Corporation 2014
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_ARM_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_ARM_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_ARM`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/ARM_architecture ARM] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__arm__`] [__predef_detection__]]
|
|
||||||
[[`__arm64`] [__predef_detection__]]
|
|
||||||
[[`__thumb__`] [__predef_detection__]]
|
|
||||||
[[`__TARGET_ARCH_ARM`] [__predef_detection__]]
|
|
||||||
[[`__TARGET_ARCH_THUMB`] [__predef_detection__]]
|
|
||||||
[[`_M_ARM`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__arm64`] [8.0.0]]
|
|
||||||
[[`__TARGET_ARCH_ARM`] [V.0.0]]
|
|
||||||
[[`__TARGET_ARCH_THUMB`] [V.0.0]]
|
|
||||||
[[`_M_ARM`] [V.0.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__arm__) || defined(__arm64) || defined(__thumb__) || \
|
|
||||||
defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB) || \
|
|
||||||
defined(_M_ARM)
|
|
||||||
# undef MSGPACK_ARCH_ARM
|
|
||||||
# if !defined(MSGPACK_ARCH_ARM) && defined(__arm64)
|
|
||||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(8,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_ARM) && defined(__TARGET_ARCH_ARM)
|
|
||||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(__TARGET_ARCH_ARM,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_ARM) && defined(__TARGET_ARCH_THUMB)
|
|
||||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(__TARGET_ARCH_THUMB,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_ARM) && defined(_M_ARM)
|
|
||||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER(_M_ARM,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_ARM)
|
|
||||||
# define MSGPACK_ARCH_ARM MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_ARM
|
|
||||||
# define MSGPACK_ARCH_ARM_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_ARM_NAME "ARM"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_ARM,MSGPACK_ARCH_ARM_NAME)
|
|
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2013-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_BLACKFIN_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_BLACKFIN_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_BLACKFIN`]
|
|
||||||
|
|
||||||
Blackfin Processors from Analog Devices.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__bfin__`] [__predef_detection__]]
|
|
||||||
[[`__BFIN__`] [__predef_detection__]]
|
|
||||||
[[`bfin`] [__predef_detection__]]
|
|
||||||
[[`BFIN`] [__predef_detection__]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_BLACKFIN MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__bfin__) || defined(__BFIN__) || \
|
|
||||||
defined(bfin) || defined(BFIN)
|
|
||||||
# undef MSGPACK_ARCH_BLACKFIN
|
|
||||||
# define MSGPACK_ARCH_BLACKFIN MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_BLACKFIN
|
|
||||||
# define MSGPACK_ARCH_BLACKFIN_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_BLACKFIN_NAME "Blackfin"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_BLACKFIN,MSGPACK_ARCH_BLACKFIN_NAME)
|
|
@@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2011-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_CONVEX_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_CONVEX_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_CONVEX`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Convex_Computer Convex Computer] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__convex__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__convex_c1__`] [1.0.0]]
|
|
||||||
[[`__convex_c2__`] [2.0.0]]
|
|
||||||
[[`__convex_c32__`] [3.2.0]]
|
|
||||||
[[`__convex_c34__`] [3.4.0]]
|
|
||||||
[[`__convex_c38__`] [3.8.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__convex__)
|
|
||||||
# undef MSGPACK_ARCH_CONVEX
|
|
||||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c1__)
|
|
||||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(1,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c2__)
|
|
||||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(2,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c32__)
|
|
||||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(3,2,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c34__)
|
|
||||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(3,4,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_CONVEX) && defined(__convex_c38__)
|
|
||||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER(3,8,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_CONVEX)
|
|
||||||
# define MSGPACK_ARCH_CONVEX MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_CONVEX
|
|
||||||
# define MSGPACK_ARCH_CONVEX_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_CONVEX_NAME "Convex Computer"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_CONVEX,MSGPACK_ARCH_CONVEX_NAME)
|
|
@@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_IA64_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_IA64_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_IA64`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Ia64 Intel Itanium 64] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__ia64__`] [__predef_detection__]]
|
|
||||||
[[`_IA64`] [__predef_detection__]]
|
|
||||||
[[`__IA64__`] [__predef_detection__]]
|
|
||||||
[[`__ia64`] [__predef_detection__]]
|
|
||||||
[[`_M_IA64`] [__predef_detection__]]
|
|
||||||
[[`__itanium__`] [__predef_detection__]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_IA64 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__ia64__) || defined(_IA64) || \
|
|
||||||
defined(__IA64__) || defined(__ia64) || \
|
|
||||||
defined(_M_IA64) || defined(__itanium__)
|
|
||||||
# undef MSGPACK_ARCH_IA64
|
|
||||||
# define MSGPACK_ARCH_IA64 MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_IA64
|
|
||||||
# define MSGPACK_ARCH_IA64_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_IA64_NAME "Intel Itanium 64"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_IA64,MSGPACK_ARCH_IA64_NAME)
|
|
@@ -1,82 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_M68K_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_M68K_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_M68K`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/M68k Motorola 68k] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__m68k__`] [__predef_detection__]]
|
|
||||||
[[`M68000`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__mc68060__`] [6.0.0]]
|
|
||||||
[[`mc68060`] [6.0.0]]
|
|
||||||
[[`__mc68060`] [6.0.0]]
|
|
||||||
[[`__mc68040__`] [4.0.0]]
|
|
||||||
[[`mc68040`] [4.0.0]]
|
|
||||||
[[`__mc68040`] [4.0.0]]
|
|
||||||
[[`__mc68030__`] [3.0.0]]
|
|
||||||
[[`mc68030`] [3.0.0]]
|
|
||||||
[[`__mc68030`] [3.0.0]]
|
|
||||||
[[`__mc68020__`] [2.0.0]]
|
|
||||||
[[`mc68020`] [2.0.0]]
|
|
||||||
[[`__mc68020`] [2.0.0]]
|
|
||||||
[[`__mc68010__`] [1.0.0]]
|
|
||||||
[[`mc68010`] [1.0.0]]
|
|
||||||
[[`__mc68010`] [1.0.0]]
|
|
||||||
[[`__mc68000__`] [0.0.1]]
|
|
||||||
[[`mc68000`] [0.0.1]]
|
|
||||||
[[`__mc68000`] [0.0.1]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__m68k__) || defined(M68000)
|
|
||||||
# undef MSGPACK_ARCH_M68K
|
|
||||||
# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68060__) || defined(mc68060) || defined(__mc68060))
|
|
||||||
# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(6,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68040__) || defined(mc68040) || defined(__mc68040))
|
|
||||||
# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(4,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68030__) || defined(mc68030) || defined(__mc68030))
|
|
||||||
# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(3,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68020__) || defined(mc68020) || defined(__mc68020))
|
|
||||||
# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(2,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68010__) || defined(mc68010) || defined(__mc68010))
|
|
||||||
# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER(1,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_M68K) && (defined(__mc68000__) || defined(mc68000) || defined(__mc68000))
|
|
||||||
# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_M68K)
|
|
||||||
# define MSGPACK_ARCH_M68K MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_M68K
|
|
||||||
# define MSGPACK_ARCH_M68K_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_M68K_NAME "Motorola 68k"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_M68K,MSGPACK_ARCH_M68K_NAME)
|
|
@@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_MIPS_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_MIPS_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_MIPS`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/MIPS_architecture MIPS] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__mips__`] [__predef_detection__]]
|
|
||||||
[[`__mips`] [__predef_detection__]]
|
|
||||||
[[`__MIPS__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__mips`] [V.0.0]]
|
|
||||||
[[`_MIPS_ISA_MIPS1`] [1.0.0]]
|
|
||||||
[[`_R3000`] [1.0.0]]
|
|
||||||
[[`_MIPS_ISA_MIPS2`] [2.0.0]]
|
|
||||||
[[`__MIPS_ISA2__`] [2.0.0]]
|
|
||||||
[[`_R4000`] [2.0.0]]
|
|
||||||
[[`_MIPS_ISA_MIPS3`] [3.0.0]]
|
|
||||||
[[`__MIPS_ISA3__`] [3.0.0]]
|
|
||||||
[[`_MIPS_ISA_MIPS4`] [4.0.0]]
|
|
||||||
[[`__MIPS_ISA4__`] [4.0.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__mips__) || defined(__mips) || \
|
|
||||||
defined(__MIPS__)
|
|
||||||
# undef MSGPACK_ARCH_MIPS
|
|
||||||
# if !defined(MSGPACK_ARCH_MIPS) && (defined(__mips))
|
|
||||||
# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(__mips,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS1) || defined(_R3000))
|
|
||||||
# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(1,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS2) || defined(__MIPS_ISA2__) || defined(_R4000))
|
|
||||||
# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(2,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS3) || defined(__MIPS_ISA3__))
|
|
||||||
# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(3,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_MIPS) && (defined(_MIPS_ISA_MIPS4) || defined(__MIPS_ISA4__))
|
|
||||||
# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER(4,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_MIPS)
|
|
||||||
# define MSGPACK_ARCH_MIPS MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_MIPS
|
|
||||||
# define MSGPACK_ARCH_MIPS_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_MIPS_NAME "MIPS"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_MIPS,MSGPACK_ARCH_MIPS_NAME)
|
|
@@ -1,64 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_PARISC_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_PARISC_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_PARISK`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/PA-RISC_family HP/PA RISC] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__hppa__`] [__predef_detection__]]
|
|
||||||
[[`__hppa`] [__predef_detection__]]
|
|
||||||
[[`__HPPA__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`_PA_RISC1_0`] [1.0.0]]
|
|
||||||
[[`_PA_RISC1_1`] [1.1.0]]
|
|
||||||
[[`__HPPA11__`] [1.1.0]]
|
|
||||||
[[`__PA7100__`] [1.1.0]]
|
|
||||||
[[`_PA_RISC2_0`] [2.0.0]]
|
|
||||||
[[`__RISC2_0__`] [2.0.0]]
|
|
||||||
[[`__HPPA20__`] [2.0.0]]
|
|
||||||
[[`__PA8000__`] [2.0.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__hppa__) || defined(__hppa) || defined(__HPPA__)
|
|
||||||
# undef MSGPACK_ARCH_PARISC
|
|
||||||
# if !defined(MSGPACK_ARCH_PARISC) && (defined(_PA_RISC1_0))
|
|
||||||
# define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER(1,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_PARISC) && (defined(_PA_RISC1_1) || defined(__HPPA11__) || defined(__PA7100__))
|
|
||||||
# define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER(1,1,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_PARISC) && (defined(_PA_RISC2_0) || defined(__RISC2_0__) || defined(__HPPA20__) || defined(__PA8000__))
|
|
||||||
# define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER(2,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_PARISC)
|
|
||||||
# define MSGPACK_ARCH_PARISC MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_PARISC
|
|
||||||
# define MSGPACK_ARCH_PARISC_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_PARISC_NAME "HP/PA RISC"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PARISC,MSGPACK_ARCH_PARISC_NAME)
|
|
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_PPC_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_PPC_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_PPC`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/PowerPC PowerPC] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__powerpc`] [__predef_detection__]]
|
|
||||||
[[`__powerpc__`] [__predef_detection__]]
|
|
||||||
[[`__POWERPC__`] [__predef_detection__]]
|
|
||||||
[[`__ppc__`] [__predef_detection__]]
|
|
||||||
[[`_M_PPC`] [__predef_detection__]]
|
|
||||||
[[`_ARCH_PPC`] [__predef_detection__]]
|
|
||||||
[[`__PPCGECKO__`] [__predef_detection__]]
|
|
||||||
[[`__PPCBROADWAY__`] [__predef_detection__]]
|
|
||||||
[[`_XENON`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__ppc601__`] [6.1.0]]
|
|
||||||
[[`_ARCH_601`] [6.1.0]]
|
|
||||||
[[`__ppc603__`] [6.3.0]]
|
|
||||||
[[`_ARCH_603`] [6.3.0]]
|
|
||||||
[[`__ppc604__`] [6.4.0]]
|
|
||||||
[[`__ppc604__`] [6.4.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__powerpc) || defined(__powerpc__) || \
|
|
||||||
defined(__POWERPC__) || defined(__ppc__) || \
|
|
||||||
defined(_M_PPC) || defined(_ARCH_PPC) || \
|
|
||||||
defined(__PPCGECKO__) || defined(__PPCBROADWAY__) || \
|
|
||||||
defined(_XENON)
|
|
||||||
# undef MSGPACK_ARCH_PPC
|
|
||||||
# if !defined (MSGPACK_ARCH_PPC) && (defined(__ppc601__) || defined(_ARCH_601))
|
|
||||||
# define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER(6,1,0)
|
|
||||||
# endif
|
|
||||||
# if !defined (MSGPACK_ARCH_PPC) && (defined(__ppc603__) || defined(_ARCH_603))
|
|
||||||
# define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER(6,3,0)
|
|
||||||
# endif
|
|
||||||
# if !defined (MSGPACK_ARCH_PPC) && (defined(__ppc604__) || defined(__ppc604__))
|
|
||||||
# define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER(6,4,0)
|
|
||||||
# endif
|
|
||||||
# if !defined (MSGPACK_ARCH_PPC)
|
|
||||||
# define MSGPACK_ARCH_PPC MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_PPC
|
|
||||||
# define MSGPACK_ARCH_PPC_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_PPC_NAME "PowerPC"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PPC,MSGPACK_ARCH_PPC_NAME)
|
|
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2011-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_PYRAMID_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_PYRAMID_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_PYRAMID`]
|
|
||||||
|
|
||||||
Pyramid 9810 architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`pyr`] [__predef_detection__]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_PYRAMID MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(pyr)
|
|
||||||
# undef MSGPACK_ARCH_PYRAMID
|
|
||||||
# define MSGPACK_ARCH_PYRAMID MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_PYRAMID
|
|
||||||
# define MSGPACK_ARCH_PYRAMID_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_PYRAMID_NAME "Pyramid 9810"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PYRAMID,MSGPACK_ARCH_PYRAMID_NAME)
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_RS6K_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_RS6K_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_RS6000`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/RS/6000 RS/6000] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__THW_RS6000`] [__predef_detection__]]
|
|
||||||
[[`_IBMR2`] [__predef_detection__]]
|
|
||||||
[[`_POWER`] [__predef_detection__]]
|
|
||||||
[[`_ARCH_PWR`] [__predef_detection__]]
|
|
||||||
[[`_ARCH_PWR2`] [__predef_detection__]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_RS6000 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__THW_RS6000) || defined(_IBMR2) || \
|
|
||||||
defined(_POWER) || defined(_ARCH_PWR) || \
|
|
||||||
defined(_ARCH_PWR2)
|
|
||||||
# undef MSGPACK_ARCH_RS6000
|
|
||||||
# define MSGPACK_ARCH_RS6000 MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_RS6000
|
|
||||||
# define MSGPACK_ARCH_RS6000_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_RS6000_NAME "RS/6000"
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_PWR MSGPACK_ARCH_RS6000
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_PWR
|
|
||||||
# define MSGPACK_ARCH_PWR_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_PWR_NAME MSGPACK_ARCH_RS6000_NAME
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_RS6000,MSGPACK_ARCH_RS6000_NAME)
|
|
@@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_SPARC_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_SPARC_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_SPARC`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/SPARC SPARC] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__sparc__`] [__predef_detection__]]
|
|
||||||
[[`__sparc`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__sparcv9`] [9.0.0]]
|
|
||||||
[[`__sparcv8`] [8.0.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_SPARC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__sparc__) || defined(__sparc)
|
|
||||||
# undef MSGPACK_ARCH_SPARC
|
|
||||||
# if !defined(MSGPACK_ARCH_SPARC) && defined(__sparcv9)
|
|
||||||
# define MSGPACK_ARCH_SPARC MSGPACK_VERSION_NUMBER(9,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_SPARC) && defined(__sparcv8)
|
|
||||||
# define MSGPACK_ARCH_SPARC MSGPACK_VERSION_NUMBER(8,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_SPARC)
|
|
||||||
# define MSGPACK_ARCH_SPARC MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_SPARC
|
|
||||||
# define MSGPACK_ARCH_SPARC_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_SPARC_NAME "SPARC"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SPARC,MSGPACK_ARCH_SPARC_NAME)
|
|
@@ -1,67 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_SUPERH_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_SUPERH_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_SH`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/SuperH SuperH] architecture:
|
|
||||||
If available versions \[1-5\] are specifically detected.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__sh__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__SH5__`] [5.0.0]]
|
|
||||||
[[`__SH4__`] [4.0.0]]
|
|
||||||
[[`__sh3__`] [3.0.0]]
|
|
||||||
[[`__SH3__`] [3.0.0]]
|
|
||||||
[[`__sh2__`] [2.0.0]]
|
|
||||||
[[`__sh1__`] [1.0.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__sh__)
|
|
||||||
# undef MSGPACK_ARCH_SH
|
|
||||||
# if !defined(MSGPACK_ARCH_SH) && (defined(__SH5__))
|
|
||||||
# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(5,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_SH) && (defined(__SH4__))
|
|
||||||
# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(4,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_SH) && (defined(__sh3__) || defined(__SH3__))
|
|
||||||
# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(3,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_SH) && (defined(__sh2__))
|
|
||||||
# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(2,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_SH) && (defined(__sh1__))
|
|
||||||
# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER(1,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_SH)
|
|
||||||
# define MSGPACK_ARCH_SH MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_SH
|
|
||||||
# define MSGPACK_ARCH_SH_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_SH_NAME "SuperH"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SH,MSGPACK_ARCH_SH_NAME)
|
|
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_SYS370_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_SYS370_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_SYS370`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/System/370 System/370] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__370__`] [__predef_detection__]]
|
|
||||||
[[`__THW_370__`] [__predef_detection__]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_SYS370 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__370__) || defined(__THW_370__)
|
|
||||||
# undef MSGPACK_ARCH_SYS370
|
|
||||||
# define MSGPACK_ARCH_SYS370 MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_SYS370
|
|
||||||
# define MSGPACK_ARCH_SYS370_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_SYS370_NAME "System/370"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SYS370,MSGPACK_ARCH_SYS370_NAME)
|
|
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_SYS390_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_SYS390_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_SYS390`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/System/390 System/390] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__s390__`] [__predef_detection__]]
|
|
||||||
[[`__s390x__`] [__predef_detection__]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_SYS390 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__s390__) || defined(__s390x__)
|
|
||||||
# undef MSGPACK_ARCH_SYS390
|
|
||||||
# define MSGPACK_ARCH_SYS390 MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_SYS390
|
|
||||||
# define MSGPACK_ARCH_SYS390_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_SYS390_NAME "System/390"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SYS390,MSGPACK_ARCH_SYS390_NAME)
|
|
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <msgpack/predef/architecture/x86/32.h>
|
|
||||||
#include <msgpack/predef/architecture/x86/64.h>
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_X86_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_X86_H
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_X86`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/X86 Intel x86] architecture. This is
|
|
||||||
a category to indicate that either `MSGPACK_ARCH_X86_32` or
|
|
||||||
`MSGPACK_ARCH_X86_64` is detected.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_X86 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_X86_32 || MSGPACK_ARCH_X86_64
|
|
||||||
# undef MSGPACK_ARCH_X86
|
|
||||||
# define MSGPACK_ARCH_X86 MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_X86
|
|
||||||
# define MSGPACK_ARCH_X86_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_X86_NAME "Intel x86"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_X86,MSGPACK_ARCH_X86_NAME)
|
|
@@ -1,87 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_X86_32_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_X86_32_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_X86_32`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/X86 Intel x86] architecture:
|
|
||||||
If available versions \[3-6\] are specifically detected.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`i386`] [__predef_detection__]]
|
|
||||||
[[`__i386__`] [__predef_detection__]]
|
|
||||||
[[`__i486__`] [__predef_detection__]]
|
|
||||||
[[`__i586__`] [__predef_detection__]]
|
|
||||||
[[`__i686__`] [__predef_detection__]]
|
|
||||||
[[`__i386`] [__predef_detection__]]
|
|
||||||
[[`_M_IX86`] [__predef_detection__]]
|
|
||||||
[[`_X86_`] [__predef_detection__]]
|
|
||||||
[[`__THW_INTEL__`] [__predef_detection__]]
|
|
||||||
[[`__I86__`] [__predef_detection__]]
|
|
||||||
[[`__INTEL__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__I86__`] [V.0.0]]
|
|
||||||
[[`_M_IX86`] [V.0.0]]
|
|
||||||
[[`__i686__`] [6.0.0]]
|
|
||||||
[[`__i586__`] [5.0.0]]
|
|
||||||
[[`__i486__`] [4.0.0]]
|
|
||||||
[[`__i386__`] [3.0.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(i386) || defined(__i386__) || \
|
|
||||||
defined(__i486__) || defined(__i586__) || \
|
|
||||||
defined(__i686__) || defined(__i386) || \
|
|
||||||
defined(_M_IX86) || defined(_X86_) || \
|
|
||||||
defined(__THW_INTEL__) || defined(__I86__) || \
|
|
||||||
defined(__INTEL__)
|
|
||||||
# undef MSGPACK_ARCH_X86_32
|
|
||||||
# if !defined(MSGPACK_ARCH_X86_32) && defined(__I86__)
|
|
||||||
# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(__I86__,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_X86_32) && defined(_M_IX86)
|
|
||||||
# define MSGPACK_ARCH_X86_32 MSGPACK_PREDEF_MAKE_10_VV00(_M_IX86)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_X86_32) && defined(__i686__)
|
|
||||||
# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(6,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_X86_32) && defined(__i586__)
|
|
||||||
# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(5,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_X86_32) && defined(__i486__)
|
|
||||||
# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(4,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_X86_32) && defined(__i386__)
|
|
||||||
# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER(3,0,0)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_ARCH_X86_32)
|
|
||||||
# define MSGPACK_ARCH_X86_32 MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_X86_32
|
|
||||||
# define MSGPACK_ARCH_X86_32_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_X86_32_NAME "Intel x86-32"
|
|
||||||
|
|
||||||
#include <msgpack/predef/architecture/x86.h>
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_X86_32,MSGPACK_ARCH_X86_32_NAME)
|
|
@@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_X86_64_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_X86_64_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_X86_64`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Ia64 Intel IA-64] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__x86_64`] [__predef_detection__]]
|
|
||||||
[[`__x86_64__`] [__predef_detection__]]
|
|
||||||
[[`__amd64__`] [__predef_detection__]]
|
|
||||||
[[`__amd64`] [__predef_detection__]]
|
|
||||||
[[`_M_X64`] [__predef_detection__]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_X86_64 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__x86_64) || defined(__x86_64__) || \
|
|
||||||
defined(__amd64__) || defined(__amd64) || \
|
|
||||||
defined(_M_X64)
|
|
||||||
# undef MSGPACK_ARCH_X86_64
|
|
||||||
# define MSGPACK_ARCH_X86_64 MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_X86_64
|
|
||||||
# define MSGPACK_ARCH_X86_64_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_X86_64_NAME "Intel x86-64"
|
|
||||||
|
|
||||||
#include <msgpack/predef/architecture/x86.h>
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_X86_64,MSGPACK_ARCH_X86_64_NAME)
|
|
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_ARCHITECTURE_Z_H
|
|
||||||
#define MSGPACK_PREDEF_ARCHITECTURE_Z_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_ARCH_Z`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Z/Architecture z/Architecture] architecture.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__SYSC_ZARCH__`] [__predef_detection__]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_Z MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__SYSC_ZARCH__)
|
|
||||||
# undef MSGPACK_ARCH_Z
|
|
||||||
# define MSGPACK_ARCH_Z MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if MSGPACK_ARCH_Z
|
|
||||||
# define MSGPACK_ARCH_Z_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_ARCH_Z_NAME "z/Architecture"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_Z,MSGPACK_ARCH_Z_NAME)
|
|
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(MSGPACK_PREDEF_COMPILER_H) || defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS)
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_H
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/compiler/borland.h>
|
|
||||||
#include <msgpack/predef/compiler/clang.h>
|
|
||||||
#include <msgpack/predef/compiler/comeau.h>
|
|
||||||
#include <msgpack/predef/compiler/compaq.h>
|
|
||||||
#include <msgpack/predef/compiler/diab.h>
|
|
||||||
#include <msgpack/predef/compiler/digitalmars.h>
|
|
||||||
#include <msgpack/predef/compiler/dignus.h>
|
|
||||||
#include <msgpack/predef/compiler/edg.h>
|
|
||||||
#include <msgpack/predef/compiler/ekopath.h>
|
|
||||||
#include <msgpack/predef/compiler/gcc_xml.h>
|
|
||||||
#include <msgpack/predef/compiler/gcc.h>
|
|
||||||
#include <msgpack/predef/compiler/greenhills.h>
|
|
||||||
#include <msgpack/predef/compiler/hp_acc.h>
|
|
||||||
#include <msgpack/predef/compiler/iar.h>
|
|
||||||
#include <msgpack/predef/compiler/ibm.h>
|
|
||||||
#include <msgpack/predef/compiler/intel.h>
|
|
||||||
#include <msgpack/predef/compiler/kai.h>
|
|
||||||
#include <msgpack/predef/compiler/llvm.h>
|
|
||||||
#include <msgpack/predef/compiler/metaware.h>
|
|
||||||
#include <msgpack/predef/compiler/metrowerks.h>
|
|
||||||
#include <msgpack/predef/compiler/microtec.h>
|
|
||||||
#include <msgpack/predef/compiler/mpw.h>
|
|
||||||
#include <msgpack/predef/compiler/palm.h>
|
|
||||||
#include <msgpack/predef/compiler/pgi.h>
|
|
||||||
#include <msgpack/predef/compiler/sgi_mipspro.h>
|
|
||||||
#include <msgpack/predef/compiler/sunpro.h>
|
|
||||||
#include <msgpack/predef/compiler/tendra.h>
|
|
||||||
#include <msgpack/predef/compiler/visualc.h>
|
|
||||||
#include <msgpack/predef/compiler/watcom.h>
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,63 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_BORLAND_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_BORLAND_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_BORLAND`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/C_plus_plus_builder Borland C++] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__BORLANDC__`] [__predef_detection__]]
|
|
||||||
[[`__CODEGEARC__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__BORLANDC__`] [V.R.P]]
|
|
||||||
[[`__CODEGEARC__`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_BORLAND MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__BORLANDC__) || defined(__CODEGEARC__)
|
|
||||||
# if !defined(MSGPACK_COMP_BORLAND_DETECTION) && (defined(__CODEGEARC__))
|
|
||||||
# define MSGPACK_COMP_BORLAND_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRP(__CODEGEARC__)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_BORLAND_DETECTION)
|
|
||||||
# define MSGPACK_COMP_BORLAND_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRP(__BORLANDC__)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_BORLAND_DETECTION
|
|
||||||
# define MSGPACK_COMP_BORLAND_AVAILABLE
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_BORLAND_EMULATED MSGPACK_COMP_BORLAND_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_BORLAND
|
|
||||||
# define MSGPACK_COMP_BORLAND MSGPACK_COMP_BORLAND_DETECTION
|
|
||||||
# endif
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_BORLAND_NAME "Borland C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_BORLAND,MSGPACK_COMP_BORLAND_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_BORLAND_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_BORLAND_EMULATED,MSGPACK_COMP_BORLAND_NAME)
|
|
||||||
#endif
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_CLANG_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_CLANG_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_CLANG`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Clang Clang] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__clang__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__clang_major__`, `__clang_minor__`, `__clang_patchlevel__`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_CLANG MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__clang__)
|
|
||||||
# define MSGPACK_COMP_CLANG_DETECTION MSGPACK_VERSION_NUMBER(__clang_major__,__clang_minor__,__clang_patchlevel__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_CLANG_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_CLANG_EMULATED MSGPACK_COMP_CLANG_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_CLANG
|
|
||||||
# define MSGPACK_COMP_CLANG MSGPACK_COMP_CLANG_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_CLANG_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_CLANG_NAME "Clang"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_CLANG,MSGPACK_COMP_CLANG_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_CLANG_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_CLANG_EMULATED,MSGPACK_COMP_CLANG_NAME)
|
|
||||||
#endif
|
|
@@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_COMEAU_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_COMEAU_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_COMO MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_COMO`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Comeau_C/C%2B%2B Comeau C++] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__COMO__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__COMO_VERSION__`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(__COMO__)
|
|
||||||
# if !defined(MSGPACK_COMP_COMO_DETECTION) && defined(__COMO_VERSION__)
|
|
||||||
# define MSGPACK_COMP_COMO_DETECTION MSGPACK_PREDEF_MAKE_0X_VRP(__COMO_VERSION__)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_COMO_DETECTION)
|
|
||||||
# define MSGPACK_COMP_COMO_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_COMO_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_COMO_EMULATED MSGPACK_COMP_COMO_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_COMO
|
|
||||||
# define MSGPACK_COMP_COMO MSGPACK_COMP_COMO_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_COMO_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_COMO_NAME "Comeau C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_COMO,MSGPACK_COMP_COMO_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_COMO_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_COMO_EMULATED,MSGPACK_COMP_COMO_NAME)
|
|
||||||
#endif
|
|
@@ -1,66 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_COMPAQ_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_COMPAQ_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_DEC`]
|
|
||||||
|
|
||||||
[@http://www.openvms.compaq.com/openvms/brochures/deccplus/ Compaq C/C++] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__DECCXX`] [__predef_detection__]]
|
|
||||||
[[`__DECC`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__DECCXX_VER`] [V.R.P]]
|
|
||||||
[[`__DECC_VER`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_DEC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__DECC) || defined(__DECCXX)
|
|
||||||
# if !defined(MSGPACK_COMP_DEC_DETECTION) && defined(__DECCXX_VER)
|
|
||||||
# define MSGPACK_COMP_DEC_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR0PP00(__DECCXX_VER)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_DEC_DETECTION) && defined(__DECC_VER)
|
|
||||||
# define MSGPACK_COMP_DEC_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR0PP00(__DECC_VER)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_DEC_DETECTION)
|
|
||||||
# define MSGPACK_COM_DEC_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_DEC_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_DEC_EMULATED MSGPACK_COMP_DEC_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_DEC
|
|
||||||
# define MSGPACK_COMP_DEC MSGPACK_COMP_DEC_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_DEC_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_DEC_NAME "Compaq C/C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DEC,MSGPACK_COMP_DEC_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_DEC_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DEC_EMULATED,MSGPACK_COMP_DEC_NAME)
|
|
||||||
#endif
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_DIAB_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_DIAB_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_DIAB`]
|
|
||||||
|
|
||||||
[@http://www.windriver.com/products/development_suite/wind_river_compiler/ Diab C/C++] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__DCC__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__VERSION_NUMBER__`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_DIAB MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__DCC__)
|
|
||||||
# define MSGPACK_COMP_DIAB_DETECTION MSGPACK_PREDEF_MAKE_10_VRPP(__VERSION_NUMBER__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_DIAB_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_DIAB_EMULATED MSGPACK_COMP_DIAB_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_DIAB
|
|
||||||
# define MSGPACK_COMP_DIAB MSGPACK_COMP_DIAB_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_DIAB_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_DIAB_NAME "Diab C/C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DIAB,MSGPACK_COMP_DIAB_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_DIAB_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DIAB_EMULATED,MSGPACK_COMP_DIAB_NAME)
|
|
||||||
#endif
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_DIGITALMARS_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_DIGITALMARS_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_DMC`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Digital_Mars Digital Mars] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__DMC__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__DMC__`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_DMC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__DMC__)
|
|
||||||
# define MSGPACK_COMP_DMC_DETECTION MSGPACK_PREDEF_MAKE_0X_VRP(__DMC__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_DMC_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_DMC_EMULATED MSGPACK_COMP_DMC_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_DMC
|
|
||||||
# define MSGPACK_COMP_DMC MSGPACK_COMP_DMC_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_DMC_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_DMC_NAME "Digital Mars"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DMC,MSGPACK_COMP_DMC_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_DMC_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_DMC_EMULATED,MSGPACK_COMP_DMC_NAME)
|
|
||||||
#endif
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_DIGNUS_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_DIGNUS_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_SYSC`]
|
|
||||||
|
|
||||||
[@http://www.dignus.com/dcxx/ Dignus Systems/C++] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__SYSC__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__SYSC_VER__`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_SYSC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__SYSC__)
|
|
||||||
# define MSGPACK_COMP_SYSC_DETECTION MSGPACK_PREDEF_MAKE_10_VRRPP(__SYSC_VER__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_SYSC_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_SYSC_EMULATED MSGPACK_COMP_SYSC_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_SYSC
|
|
||||||
# define MSGPACK_COMP_SYSC MSGPACK_COMP_SYSC_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_SYSC_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_SYSC_NAME "Dignus Systems/C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SYSC,MSGPACK_COMP_SYSC_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_SYSC_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SYSC_EMULATED,MSGPACK_COMP_SYSC_NAME)
|
|
||||||
#endif
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_EDG_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_EDG_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_EDG`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Edison_Design_Group EDG C++ Frontend] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__EDG__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__EDG_VERSION__`] [V.R.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_EDG MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__EDG__)
|
|
||||||
# define MSGPACK_COMP_EDG_DETECTION MSGPACK_PREDEF_MAKE_10_VRR(__EDG_VERSION__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_EDG_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_EDG_EMULATED MSGPACK_COMP_EDG_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_EDG
|
|
||||||
# define MSGPACK_COMP_EDG MSGPACK_COMP_EDG_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_EDG_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_EDG_NAME "EDG C++ Frontend"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_EDG,MSGPACK_COMP_EDG_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_EDG_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_EDG_EMULATED,MSGPACK_COMP_EDG_NAME)
|
|
||||||
#endif
|
|
@@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_EKOPATH_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_EKOPATH_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_PATH`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/PathScale EKOpath] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__PATHCC__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__PATHCC__`, `__PATHCC_MINOR__`, `__PATHCC_PATCHLEVEL__`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_PATH MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__PATHCC__)
|
|
||||||
# define MSGPACK_COMP_PATH_DETECTION \
|
|
||||||
MSGPACK_VERSION_NUMBER(__PATHCC__,__PATHCC_MINOR__,__PATHCC_PATCHLEVEL__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_PATH_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_PATH_EMULATED MSGPACK_COMP_PATH_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_PATH
|
|
||||||
# define MSGPACK_COMP_PATH MSGPACK_COMP_PATH_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_PATH_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_PATH_NAME "EKOpath"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PATH,MSGPACK_COMP_PATH_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_PATH_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PATH_EMULATED,MSGPACK_COMP_PATH_NAME)
|
|
||||||
#endif
|
|
@@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_GCC_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_GCC_H
|
|
||||||
|
|
||||||
/* Other compilers that emulate this one need to be detected first. */
|
|
||||||
|
|
||||||
#include <msgpack/predef/compiler/clang.h>
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_GNUC`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/GNU_Compiler_Collection Gnu GCC C/C++] compiler.
|
|
||||||
Version number available as major, minor, and patch (if available).
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__GNUC__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__GNUC__`, `__GNUC_MINOR__`, `__GNUC_PATCHLEVEL__`] [V.R.P]]
|
|
||||||
[[`__GNUC__`, `__GNUC_MINOR__`] [V.R.0]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_GNUC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
# if !defined(MSGPACK_COMP_GNUC_DETECTION) && defined(__GNUC_PATCHLEVEL__)
|
|
||||||
# define MSGPACK_COMP_GNUC_DETECTION \
|
|
||||||
MSGPACK_VERSION_NUMBER(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_GNUC_DETECTION)
|
|
||||||
# define MSGPACK_COMP_GNUC_DETECTION \
|
|
||||||
MSGPACK_VERSION_NUMBER(__GNUC__,__GNUC_MINOR__,0)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_GNUC_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_GNUC_EMULATED MSGPACK_COMP_GNUC_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_GNUC
|
|
||||||
# define MSGPACK_COMP_GNUC MSGPACK_COMP_GNUC_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_GNUC_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_GNUC_NAME "Gnu GCC C/C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GNUC,MSGPACK_COMP_GNUC_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_GNUC_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GNUC_EMULATED,MSGPACK_COMP_GNUC_NAME)
|
|
||||||
#endif
|
|
@@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_GCC_XML_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_GCC_XML_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_GCCXML`]
|
|
||||||
|
|
||||||
[@http://www.gccxml.org/ GCC XML] compiler.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__GCCXML__`] [__predef_detection__]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_GCCXML MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__GCCXML__)
|
|
||||||
# define MSGPACK_COMP_GCCXML_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_GCCXML_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_GCCXML_EMULATED MSGPACK_COMP_GCCXML_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_GCCXML
|
|
||||||
# define MSGPACK_COMP_GCCXML MSGPACK_COMP_GCCXML_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_GCCXML_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_GCCXML_NAME "GCC XML"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GCCXML,MSGPACK_COMP_GCCXML_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_GCCXML_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GCCXML_EMULATED,MSGPACK_COMP_GCCXML_NAME)
|
|
||||||
#endif
|
|
@@ -1,66 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_GREENHILLS_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_GREENHILLS_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_GHS`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Green_Hills_Software Green Hills C/C++] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__ghs`] [__predef_detection__]]
|
|
||||||
[[`__ghs__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__GHS_VERSION_NUMBER__`] [V.R.P]]
|
|
||||||
[[`__ghs`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_GHS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__ghs) || defined(__ghs__)
|
|
||||||
# if !defined(MSGPACK_COMP_GHS_DETECTION) && defined(__GHS_VERSION_NUMBER__)
|
|
||||||
# define MSGPACK_COMP_GHS_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(__GHS_VERSION_NUMBER__)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_GHS_DETECTION) && defined(__ghs)
|
|
||||||
# define MSGPACK_COMP_GHS_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(__ghs)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_GHS_DETECTION)
|
|
||||||
# define MSGPACK_COMP_GHS_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_GHS_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_GHS_EMULATED MSGPACK_COMP_GHS_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_GHS
|
|
||||||
# define MSGPACK_COMP_GHS MSGPACK_COMP_GHS_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_GHS_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_GHS_NAME "Green Hills C/C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GHS,MSGPACK_COMP_GHS_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_GHS_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_GHS_EMULATED,MSGPACK_COMP_GHS_NAME)
|
|
||||||
#endif
|
|
@@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_HP_ACC_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_HP_ACC_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_HPACC`]
|
|
||||||
|
|
||||||
HP aC++ compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__HP_aCC`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__HP_aCC`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_HPACC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__HP_aCC)
|
|
||||||
# if !defined(MSGPACK_COMP_HPACC_DETECTION) && (__HP_aCC > 1)
|
|
||||||
# define MSGPACK_COMP_HPACC_DETECTION MSGPACK_PREDEF_MAKE_10_VVRRPP(__HP_aCC)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_HPACC_DETECTION)
|
|
||||||
# define MSGPACK_COMP_HPACC_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_HPACC_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_HPACC_EMULATED MSGPACK_COMP_HPACC_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_HPACC
|
|
||||||
# define MSGPACK_COMP_HPACC MSGPACK_COMP_HPACC_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_HPACC_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_HPACC_NAME "HP aC++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_HPACC,MSGPACK_COMP_HPACC_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_HPACC_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_HPACC_EMULATED,MSGPACK_COMP_HPACC_NAME)
|
|
||||||
#endif
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_IAR_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_IAR_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_IAR`]
|
|
||||||
|
|
||||||
IAR C/C++ compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__IAR_SYSTEMS_ICC__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__VER__`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_IAR MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__IAR_SYSTEMS_ICC__)
|
|
||||||
# define MSGPACK_COMP_IAR_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR(__VER__)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_IAR_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_IAR_EMULATED MSGPACK_COMP_IAR_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_IAR
|
|
||||||
# define MSGPACK_COMP_IAR MSGPACK_COMP_IAR_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_IAR_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_IAR_NAME "IAR C/C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_IAR,MSGPACK_COMP_IAR_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_IAR_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_IAR_EMULATED,MSGPACK_COMP_IAR_NAME)
|
|
||||||
#endif
|
|
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_IBM_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_IBM_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_IBM`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/VisualAge IBM XL C/C++] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__IBMCPP__`] [__predef_detection__]]
|
|
||||||
[[`__xlC__`] [__predef_detection__]]
|
|
||||||
[[`__xlc__`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__COMPILER_VER__`] [V.R.P]]
|
|
||||||
[[`__xlC__`] [V.R.P]]
|
|
||||||
[[`__xlc__`] [V.R.P]]
|
|
||||||
[[`__IBMCPP__`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_IBM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__IBMCPP__) || defined(__xlC__) || defined(__xlc__)
|
|
||||||
# if !defined(MSGPACK_COMP_IBM_DETECTION) && defined(__COMPILER_VER__)
|
|
||||||
# define MSGPACK_COMP_IBM_DETECTION MSGPACK_PREDEF_MAKE_0X_VRRPPPP(__COMPILER_VER__)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_IBM_DETECTION) && defined(__xlC__)
|
|
||||||
# define MSGPACK_COMP_IBM_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRR(__xlC__)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_IBM_DETECTION) && defined(__xlc__)
|
|
||||||
# define MSGPACK_COMP_IBM_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRR(__xlc__)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_IBM_DETECTION)
|
|
||||||
# define MSGPACK_COMP_IBM_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(__IBMCPP__)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_IBM_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_IBM_EMULATED MSGPACK_COMP_IBM_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_IBM
|
|
||||||
# define MSGPACK_COMP_IBM MSGPACK_COMP_IBM_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_IBM_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_IBM_NAME "IBM XL C/C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_IBM,MSGPACK_COMP_IBM_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_IBM_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_IBM_EMULATED,MSGPACK_COMP_IBM_NAME)
|
|
||||||
#endif
|
|
@@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_INTEL_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_INTEL_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_INTEL`]
|
|
||||||
|
|
||||||
[@http://en.wikipedia.org/wiki/Intel_C%2B%2B Intel C/C++] compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__INTEL_COMPILER`] [__predef_detection__]]
|
|
||||||
[[`__ICL`] [__predef_detection__]]
|
|
||||||
[[`__ICC`] [__predef_detection__]]
|
|
||||||
[[`__ECC`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__INTEL_COMPILER`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_INTEL MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || \
|
|
||||||
defined(__ECC)
|
|
||||||
# if !defined(MSGPACK_COMP_INTEL_DETECTION) && defined(__INTEL_COMPILER)
|
|
||||||
# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(__INTEL_COMPILER)
|
|
||||||
# endif
|
|
||||||
# if !defined(MSGPACK_COMP_INTEL_DETECTION)
|
|
||||||
# define MSGPACK_COMP_INTEL_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_INTEL_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_INTEL_EMULATED MSGPACK_COMP_INTEL_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_INTEL
|
|
||||||
# define MSGPACK_COMP_INTEL MSGPACK_COMP_INTEL_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_INTEL_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_INTEL_NAME "Intel C/C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_INTEL,MSGPACK_COMP_INTEL_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_INTEL_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_INTEL_EMULATED,MSGPACK_COMP_INTEL_NAME)
|
|
||||||
#endif
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright Rene Rivera 2008-2015
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(See accompanying file LICENSE_1_0.txt or copy at
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef MSGPACK_PREDEF_COMPILER_KAI_H
|
|
||||||
#define MSGPACK_PREDEF_COMPILER_KAI_H
|
|
||||||
|
|
||||||
#include <msgpack/predef/version_number.h>
|
|
||||||
#include <msgpack/predef/make.h>
|
|
||||||
|
|
||||||
/*`
|
|
||||||
[heading `MSGPACK_COMP_KCC`]
|
|
||||||
|
|
||||||
Kai C++ compiler.
|
|
||||||
Version number available as major, minor, and patch.
|
|
||||||
|
|
||||||
[table
|
|
||||||
[[__predef_symbol__] [__predef_version__]]
|
|
||||||
|
|
||||||
[[`__KCC`] [__predef_detection__]]
|
|
||||||
|
|
||||||
[[`__KCC_VERSION`] [V.R.P]]
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_KCC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
|
|
||||||
|
|
||||||
#if defined(__KCC)
|
|
||||||
# define MSGPACK_COMP_KCC_DETECTION MSGPACK_PREDEF_MAKE_0X_VRPP(__KCC_VERSION)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_KCC_DETECTION
|
|
||||||
# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
|
|
||||||
# define MSGPACK_COMP_KCC_EMULATED MSGPACK_COMP_KCC_DETECTION
|
|
||||||
# else
|
|
||||||
# undef MSGPACK_COMP_KCC
|
|
||||||
# define MSGPACK_COMP_KCC MSGPACK_COMP_KCC_DETECTION
|
|
||||||
# endif
|
|
||||||
# define MSGPACK_COMP_KCC_AVAILABLE
|
|
||||||
# include <msgpack/predef/detail/comp_detected.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSGPACK_COMP_KCC_NAME "Kai C++"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_KCC,MSGPACK_COMP_KCC_NAME)
|
|
||||||
|
|
||||||
#ifdef MSGPACK_COMP_KCC_EMULATED
|
|
||||||
#include <msgpack/predef/detail/test.h>
|
|
||||||
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_KCC_EMULATED,MSGPACK_COMP_KCC_NAME)
|
|
||||||
#endif
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user