[libdata-messagepack-perl] 01/10: New upstream version 1.00
Christopher Hoskin
christopher.hoskin at gmail.com
Sat Sep 17 05:16:42 UTC 2016
This is an automated email from the git hooks/post-receive script.
grinorcole-guest pushed a commit to branch master
in repository libdata-messagepack-perl.
commit 637dd18080d62ef787d3fffc3dc9a72f8538d382
Author: Christopher Hoskin <christopher.hoskin at gmail.com>
Date: Fri Sep 16 19:59:24 2016 +0100
New upstream version 1.00
---
.gitmodules | 6 +-
.travis.yml | 9 +
Changes | 31 +-
LICENSE | 379 ++++++++++
MANIFEST | 122 ++-
META.yml | 10 +-
Makefile.PL | 36 +-
inc/Module/Install.pm | 22 +-
inc/Module/Install/Base.pm | 2 +-
inc/Module/Install/Can.pm | 2 +-
inc/Module/Install/Fetch.pm | 2 +-
inc/Module/Install/Makefile.pm | 4 +-
inc/Module/Install/Metadata.pm | 6 +-
inc/Module/Install/Win32.pm | 2 +-
inc/Module/Install/WriteAll.pm | 2 +-
inc/Module/Install/XSUtil.pm | 4 +-
include/msgpack.h | 24 +
include/msgpack/pack.h | 147 ++++
include/msgpack/pack_define.h | 18 +-
include/msgpack/pack_template.h | 876 +++++++++++++---------
include/msgpack/predef.h | 19 +
include/msgpack/predef/architecture.h | 30 +
include/msgpack/predef/architecture/alpha.h | 60 ++
include/msgpack/predef/architecture/arm.h | 71 ++
include/msgpack/predef/architecture/blackfin.h | 47 ++
include/msgpack/predef/architecture/convex.h | 67 ++
include/msgpack/predef/architecture/ia64.h | 49 ++
include/msgpack/predef/architecture/m68k.h | 83 ++
include/msgpack/predef/architecture/mips.h | 74 ++
include/msgpack/predef/architecture/parisc.h | 65 ++
include/msgpack/predef/architecture/ppc.h | 73 ++
include/msgpack/predef/architecture/pyramid.h | 43 ++
include/msgpack/predef/architecture/rs6k.h | 56 ++
include/msgpack/predef/architecture/sparc.h | 55 ++
include/msgpack/predef/architecture/superh.h | 68 ++
include/msgpack/predef/architecture/sys370.h | 44 ++
include/msgpack/predef/architecture/sys390.h | 44 ++
include/msgpack/predef/architecture/x86.h | 38 +
include/msgpack/predef/architecture/x86/32.h | 87 +++
include/msgpack/predef/architecture/x86/64.h | 50 ++
include/msgpack/predef/architecture/z.h | 43 ++
include/msgpack/predef/compiler.h | 41 +
include/msgpack/predef/compiler/borland.h | 64 ++
include/msgpack/predef/compiler/clang.h | 57 ++
include/msgpack/predef/compiler/comeau.h | 62 ++
include/msgpack/predef/compiler/compaq.h | 67 ++
include/msgpack/predef/compiler/diab.h | 57 ++
include/msgpack/predef/compiler/digitalmars.h | 57 ++
include/msgpack/predef/compiler/dignus.h | 57 ++
include/msgpack/predef/compiler/edg.h | 57 ++
include/msgpack/predef/compiler/ekopath.h | 58 ++
include/msgpack/predef/compiler/gcc.h | 69 ++
include/msgpack/predef/compiler/gcc_xml.h | 53 ++
include/msgpack/predef/compiler/greenhills.h | 67 ++
include/msgpack/predef/compiler/hp_acc.h | 62 ++
include/msgpack/predef/compiler/iar.h | 57 ++
include/msgpack/predef/compiler/ibm.h | 73 ++
include/msgpack/predef/compiler/intel.h | 66 ++
include/msgpack/predef/compiler/kai.h | 57 ++
include/msgpack/predef/compiler/llvm.h | 58 ++
include/msgpack/predef/compiler/metaware.h | 54 ++
include/msgpack/predef/compiler/metrowerks.h | 78 ++
include/msgpack/predef/compiler/microtec.h | 54 ++
include/msgpack/predef/compiler/mpw.h | 64 ++
include/msgpack/predef/compiler/palm.h | 57 ++
include/msgpack/predef/compiler/pgi.h | 61 ++
include/msgpack/predef/compiler/sgi_mipspro.h | 67 ++
include/msgpack/predef/compiler/sunpro.h | 67 ++
include/msgpack/predef/compiler/tendra.h | 54 ++
include/msgpack/predef/compiler/visualc.h | 92 +++
include/msgpack/predef/compiler/watcom.h | 57 ++
include/msgpack/predef/detail/_cassert.h | 17 +
include/msgpack/predef/detail/_exception.h | 15 +
include/msgpack/predef/detail/comp_detected.h | 10 +
include/msgpack/predef/detail/endian_compat.h | 26 +
include/msgpack/predef/detail/os_detected.h | 10 +
include/msgpack/predef/detail/platform_detected.h | 10 +
include/msgpack/predef/detail/test.h | 17 +
include/msgpack/predef/language.h | 15 +
include/msgpack/predef/language/objc.h | 43 ++
include/msgpack/predef/language/stdc.h | 54 ++
include/msgpack/predef/language/stdcpp.h | 124 +++
include/msgpack/predef/library.h | 14 +
include/msgpack/predef/library/c.h | 18 +
include/msgpack/predef/library/c/_prefix.h | 13 +
include/msgpack/predef/library/c/gnu.h | 62 ++
include/msgpack/predef/library/c/uc.h | 48 ++
include/msgpack/predef/library/c/vms.h | 48 ++
include/msgpack/predef/library/c/zos.h | 57 ++
include/msgpack/predef/library/std.h | 23 +
include/msgpack/predef/library/std/_prefix.h | 23 +
include/msgpack/predef/library/std/cxx.h | 47 ++
include/msgpack/predef/library/std/dinkumware.h | 53 ++
include/msgpack/predef/library/std/libcomo.h | 48 ++
include/msgpack/predef/library/std/modena.h | 46 ++
include/msgpack/predef/library/std/msl.h | 54 ++
include/msgpack/predef/library/std/roguewave.h | 57 ++
include/msgpack/predef/library/std/sgi.h | 52 ++
include/msgpack/predef/library/std/stdcpp3.h | 54 ++
include/msgpack/predef/library/std/stlport.h | 60 ++
include/msgpack/predef/library/std/vacpp.h | 45 ++
include/msgpack/predef/make.h | 89 +++
include/msgpack/predef/os.h | 31 +
include/msgpack/predef/os/aix.h | 67 ++
include/msgpack/predef/os/amigaos.h | 47 ++
include/msgpack/predef/os/android.h | 46 ++
include/msgpack/predef/os/beos.h | 46 ++
include/msgpack/predef/os/bsd.h | 95 +++
include/msgpack/predef/os/bsd/bsdi.h | 48 ++
include/msgpack/predef/os/bsd/dragonfly.h | 50 ++
include/msgpack/predef/os/bsd/free.h | 60 ++
include/msgpack/predef/os/bsd/net.h | 84 +++
include/msgpack/predef/os/bsd/open.h | 171 +++++
include/msgpack/predef/os/cygwin.h | 46 ++
include/msgpack/predef/os/haiku.h | 47 ++
include/msgpack/predef/os/hpux.h | 48 ++
include/msgpack/predef/os/ios.h | 51 ++
include/msgpack/predef/os/irix.h | 47 ++
include/msgpack/predef/os/linux.h | 47 ++
include/msgpack/predef/os/macos.h | 66 ++
include/msgpack/predef/os/os400.h | 46 ++
include/msgpack/predef/os/qnxnto.h | 60 ++
include/msgpack/predef/os/solaris.h | 47 ++
include/msgpack/predef/os/unix.h | 76 ++
include/msgpack/predef/os/vms.h | 53 ++
include/msgpack/predef/os/windows.h | 51 ++
include/msgpack/predef/other.h | 14 +
include/msgpack/predef/other/endian.h | 205 +++++
include/msgpack/predef/platform.h | 19 +
include/msgpack/predef/platform/mingw.h | 70 ++
include/msgpack/predef/platform/windows_desktop.h | 44 ++
include/msgpack/predef/platform/windows_phone.h | 42 ++
include/msgpack/predef/platform/windows_runtime.h | 44 ++
include/msgpack/predef/platform/windows_store.h | 42 ++
include/msgpack/predef/version.h | 15 +
include/msgpack/predef/version_number.h | 54 ++
include/msgpack/sysdep.h | 286 ++++---
include/msgpack/unpack.h | 270 +++++++
include/msgpack/unpack_define.h | 108 ++-
include/msgpack/unpack_template.h | 681 +++++++++--------
lib/Data/MessagePack.pm | 4 +-
lib/Data/MessagePack/Boolean.pm | 1 +
lib/Data/MessagePack/PP.pm | 95 ++-
t/01_pack.t | 51 +-
t/05_preferred_int.t | 57 +-
t/09_stddata.t | 30 +-
t/data.pl | 8 +
t/std/cases.json | 1 -
xs-src/pack.c | 39 +-
xs-src/unpack.c | 27 +-
xshelper.h | 2 +-
151 files changed, 8580 insertions(+), 1025 deletions(-)
diff --git a/.gitmodules b/.gitmodules
index 81f1e6a..f3a9054 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
-[submodule "msgpack"]
- path = msgpack
- url = git://github.com/msgpack/msgpack.git
+[submodule "msgpack-c"]
+ path = msgpack-c
+ url = git://github.com/msgpack/msgpack-c.git
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..12b8c1f
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,9 @@
+sudo: false
+language: perl
+install: cpanm --installdeps --notest --verbose .
+before_install:
+ - perlbrew install-cpanm -f
+ - cpanm --notest Module::Install Module::Install::XSUtil Module::Install::AuthorTests
+perl:
+ - "5.20"
+ - "5.22"
diff --git a/Changes b/Changes
index 946bcbf..771e6a2 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,24 @@
+1.00 2016-08-21 15:30:00+0900
+
+ - Update major version for MessagePack versioning rule
+ - Support Bin/Str type again
+
+0.51 2016-08-21 15:20:00+0900
+
+ - Revert supporting Bin/Str type changes for MessagePack versioning rule
+
+0.50 2016-06-15 12:09:00+0900
+
+ - No feature changes. Official release for supporting Bin/Str format
+
+0.49_01 2016-03-01 14:40:00+0900
+
+ - Support Bin/Str type of newer MessegePack specification
+
+0.49 2015-11-21 20:07:30+0900
+
+ - Fix undefined behavior issue of overflow(#23, #24, Thanks kazuho)
+
0.48 2013-09-01 15:42:51+0900
- Fix tests for bleadperl
@@ -23,7 +44,7 @@
T::Xslate using it...
0.43 2012-06-26T02:00:57
-
+
- Data::MessagePack::Unpacker was deprecated.
@@ -41,20 +62,20 @@
- Fix tests on NV == long double env
0.39 2011-12-05 00:08:58
-
+
- Resolve RT #72920 - packing float numbers fails on some cases,
e.g. after e.g. $flaot > 0
0.38_02 2011-10-25 09:58:28
-
+
- More informative tests
0.38_01 2011-10-25 09:44:05
-
+
- Add tests to reveal problems in Data::Encoder
0.38 2011-10-10 16:17:03
-
+
- Add tests to unpacking double - the test was missing!
0.37 2011-10-10 16:08:18
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..f5edd30
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,379 @@
+This software is copyright (c) 2015- by Tokuhiro Matsuno.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+Terms of the Perl programming language system itself
+
+a) the GNU General Public License as published by the Free
+ Software Foundation; either version 1, or (at your option) any
+ later version, or
+b) the "Artistic License"
+
+--- The GNU General Public License, Version 1, February 1989 ---
+
+This software is Copyright (c) 2015- by Nikolay Mishin < mi at ya.ru >.
+
+This is free software, licensed under:
+
+ The GNU General Public License, Version 1, February 1989
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 1, February 1989
+
+ Copyright (C) 1989 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The license agreements of most software companies try to keep users
+at the mercy of those companies. By contrast, our General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. The
+General Public License applies to the Free Software Foundation's
+software and to any other program whose authors commit to using it.
+You can use it for your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Specifically, the General Public License is designed to make
+sure that you have the freedom to give away or sell copies of free
+software, that you receive source code or can get it if you want it,
+that you can change the software or use pieces of it in new free
+programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of a such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must tell them their rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any program or other work which
+contains a notice placed by the copyright holder saying it may be
+distributed under the terms of this General Public License. The
+"Program", below, refers to any such program or work, and a "work based
+on the Program" means either the Program or any work containing the
+Program or a portion of it, either verbatim or with modifications. Each
+licensee is addressed as "you".
+
+ 1. You may copy and distribute verbatim copies of the Program's source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this
+General Public License and to the absence of any warranty; and give any
+other recipients of the Program a copy of this General Public License
+along with the Program. You may charge a fee for the physical act of
+transferring a copy.
+
+ 2. You may modify your copy or copies of the Program or any portion of
+it, and copy and distribute such modifications under the terms of Paragraph
+1 above, provided that you also do the following:
+
+ a) cause the modified files to carry prominent notices stating that
+ you changed the files and the date of any change; and
+
+ b) cause the whole of any work that you distribute or publish, that
+ in whole or in part contains the Program or any part thereof, either
+ with or without modifications, to be licensed at no charge to all
+ third parties under the terms of this General Public License (except
+ that you may choose to grant warranty protection to some or all
+ third parties, at your option).
+
+ c) If the modified program normally reads commands interactively when
+ run, you must cause it, when started running for such interactive use
+ in the simplest and most usual way, to print or display an
+ announcement including an appropriate copyright notice and a notice
+ that there is no warranty (or else, saying that you provide a
+ warranty) and that users may redistribute the program under these
+ conditions, and telling the user how to view a copy of this General
+ Public License.
+
+ d) You may charge a fee for the physical act of transferring a
+ copy, and you may at your option offer warranty protection in
+ exchange for a fee.
+
+Mere aggregation of another independent work with the Program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other work under the scope of these terms.
+
+ 3. You may copy and distribute the Program (or a portion or derivative of
+it, under Paragraph 2) in object code or executable form under the terms of
+Paragraphs 1 and 2 above provided that you also do one of the following:
+
+ a) accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ b) accompany it with a written offer, valid for at least three
+ years, to give any third party free (except for a nominal charge
+ for the cost of distribution) a complete machine-readable copy of the
+ corresponding source code, to be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ c) accompany it with the information you received as to where the
+ corresponding source code may be obtained. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form alone.)
+
+Source code for a work means the preferred form of the work for making
+modifications to it. For an executable file, complete source code means
+all the source code for all modules it contains; but, as a special
+exception, it need not include source code for modules which are standard
+libraries that accompany the operating system on which the executable
+file runs, or for standard header files or definitions files that
+accompany that operating system.
+
+ 4. You may not copy, modify, sublicense, distribute or transfer the
+Program except as expressly provided under this General Public License.
+Any attempt otherwise to copy, modify, sublicense, distribute or transfer
+the Program is void, and will automatically terminate your rights to use
+the Program under this License. However, parties who have received
+copies, or rights to use copies, from you under this General Public
+License will not have their licenses terminated so long as such parties
+remain in full compliance.
+
+ 5. By copying, distributing or modifying the Program (or any work based
+on the Program) you indicate your acceptance of this license to do so,
+and all its terms and conditions.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these
+terms and conditions. You may not impose any further restrictions on the
+recipients' exercise of the rights granted herein.
+
+ 7. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of the license which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+the license, you may choose any version ever published by the Free Software
+Foundation.
+
+ 8. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to humanity, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest to
+attach them to the start of each source file to most effectively convey
+the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19xx name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the
+appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than `show w' and `show
+c'; they could even be mouse-clicks or menu items--whatever suits your
+program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ program `Gnomovision' (a program to direct compilers to make passes
+ at assemblers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+--- The Artistic License 1.0 ---
+
+This software is Copyright (c) 2015- by Nikolay Mishin < mi at ya.ru >.
+
+This is free software, licensed under:
+
+ The Artistic License 1.0
+
+The Artistic License
+
+Preamble
+
+The intent of this document is to state the conditions under which a Package
+may be copied, such that the Copyright Holder maintains some semblance of
+artistic control over the development of the package, while giving the users of
+the package the right to use and distribute the Package in a more-or-less
+customary fashion, plus the right to make reasonable modifications.
+
+Definitions:
+
+ - "Package" refers to the collection of files distributed by the Copyright
+ Holder, and derivatives of that collection of files created through
+ textual modification.
+ - "Standard Version" refers to such a Package if it has not been modified,
+ or has been modified in accordance with the wishes of the Copyright
+ Holder.
+ - "Copyright Holder" is whoever is named in the copyright or copyrights for
+ the package.
+ - "You" is you, if you're thinking about copying or distributing this Package.
+ - "Reasonable copying fee" is whatever you can justify on the basis of media
+ cost, duplication charges, time of people involved, and so on. (You will
+ not be required to justify it to the Copyright Holder, but only to the
+ computing community at large as a market that must bear the fee.)
+ - "Freely Available" means that no fee is charged for the item itself, though
+ there may be fees involved in handling the item. It also means that
+ recipients of the item may redistribute it under the same conditions they
+ received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications derived
+from the Public Domain or from the Copyright Holder. A Package modified in such
+a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided that
+you insert a prominent notice in each changed file stating how and when you
+changed that file, and provided that you do at least ONE of the following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or an
+ equivalent medium, or placing the modifications on a major archive site
+ such as ftp.uu.net, or by allowing the Copyright Holder to include your
+ modifications in the Standard Version of the Package.
+
+ b) use the modified Package only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict with
+ standard executables, which must also be provided, and provide a separate
+ manual page for each non-standard executable that clearly documents how it
+ differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or executable
+form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where to
+ get the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of the Package
+ with your modifications.
+
+ c) accompany any non-standard executables with their corresponding Standard
+ Version executables, giving the non-standard executables non-standard
+ names, and clearly documenting the differences in manual pages (or
+ equivalent), together with instructions on where to get the Standard
+ Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this
+Package. You may charge any fee you choose for support of this Package. You
+may not charge a fee for this Package itself. However, you may distribute this
+Package in aggregate with other (possibly commercial) programs as part of a
+larger (possibly commercial) software distribution provided that you do not
+advertise this Package as a product of your own.
+
+6. The scripts and library files supplied as input to or produced as output
+from the programs of this Package do not automatically fall under the copyright
+of this Package, but belong to whomever generated them, and may be sold
+commercially, and may be aggregated with this Package.
+
+7. C or perl subroutines supplied by you and linked into this Package shall not
+be considered part of this Package.
+
+8. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
+
diff --git a/MANIFEST b/MANIFEST
index c14139d..90f18d0 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,5 @@
.gitmodules
+.travis.yml
benchmark/data.pl
benchmark/deserialize.pl
benchmark/serialize.pl
@@ -14,15 +15,135 @@ inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
inc/Module/Install/XSUtil.pm
+include/msgpack.h
+include/msgpack/pack.h
include/msgpack/pack_define.h
include/msgpack/pack_template.h
+include/msgpack/predef.h
+include/msgpack/predef/architecture.h
+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/x86/32.h
+include/msgpack/predef/architecture/x86/64.h
+include/msgpack/predef/architecture/z.h
+include/msgpack/predef/compiler.h
+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.h
+include/msgpack/predef/compiler/gcc_xml.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
+include/msgpack/predef/detail/_cassert.h
+include/msgpack/predef/detail/_exception.h
+include/msgpack/predef/detail/comp_detected.h
+include/msgpack/predef/detail/endian_compat.h
+include/msgpack/predef/detail/os_detected.h
+include/msgpack/predef/detail/platform_detected.h
+include/msgpack/predef/detail/test.h
+include/msgpack/predef/language.h
+include/msgpack/predef/language/objc.h
+include/msgpack/predef/language/stdc.h
+include/msgpack/predef/language/stdcpp.h
+include/msgpack/predef/library.h
+include/msgpack/predef/library/c.h
+include/msgpack/predef/library/c/_prefix.h
+include/msgpack/predef/library/c/gnu.h
+include/msgpack/predef/library/c/uc.h
+include/msgpack/predef/library/c/vms.h
+include/msgpack/predef/library/c/zos.h
+include/msgpack/predef/library/std.h
+include/msgpack/predef/library/std/_prefix.h
+include/msgpack/predef/library/std/cxx.h
+include/msgpack/predef/library/std/dinkumware.h
+include/msgpack/predef/library/std/libcomo.h
+include/msgpack/predef/library/std/modena.h
+include/msgpack/predef/library/std/msl.h
+include/msgpack/predef/library/std/roguewave.h
+include/msgpack/predef/library/std/sgi.h
+include/msgpack/predef/library/std/stdcpp3.h
+include/msgpack/predef/library/std/stlport.h
+include/msgpack/predef/library/std/vacpp.h
+include/msgpack/predef/make.h
+include/msgpack/predef/os.h
+include/msgpack/predef/os/aix.h
+include/msgpack/predef/os/amigaos.h
+include/msgpack/predef/os/android.h
+include/msgpack/predef/os/beos.h
+include/msgpack/predef/os/bsd.h
+include/msgpack/predef/os/bsd/bsdi.h
+include/msgpack/predef/os/bsd/dragonfly.h
+include/msgpack/predef/os/bsd/free.h
+include/msgpack/predef/os/bsd/net.h
+include/msgpack/predef/os/bsd/open.h
+include/msgpack/predef/os/cygwin.h
+include/msgpack/predef/os/haiku.h
+include/msgpack/predef/os/hpux.h
+include/msgpack/predef/os/ios.h
+include/msgpack/predef/os/irix.h
+include/msgpack/predef/os/linux.h
+include/msgpack/predef/os/macos.h
+include/msgpack/predef/os/os400.h
+include/msgpack/predef/os/qnxnto.h
+include/msgpack/predef/os/solaris.h
+include/msgpack/predef/os/unix.h
+include/msgpack/predef/os/vms.h
+include/msgpack/predef/os/windows.h
+include/msgpack/predef/other.h
+include/msgpack/predef/other/endian.h
+include/msgpack/predef/platform.h
+include/msgpack/predef/platform/mingw.h
+include/msgpack/predef/platform/windows_desktop.h
+include/msgpack/predef/platform/windows_phone.h
+include/msgpack/predef/platform/windows_runtime.h
+include/msgpack/predef/platform/windows_store.h
+include/msgpack/predef/version.h
+include/msgpack/predef/version_number.h
include/msgpack/sysdep.h
+include/msgpack/unpack.h
include/msgpack/unpack_define.h
include/msgpack/unpack_template.h
lib/Data/MessagePack.pm
lib/Data/MessagePack/Boolean.pm
lib/Data/MessagePack/PP.pm
lib/Data/MessagePack/Unpacker.pod
+LICENSE
Makefile.PL
MANIFEST This list of files
META.yml
@@ -55,7 +176,6 @@ t/24_tied.t
t/40_threads.t
t/50_leaktrace.t
t/data.pl
-t/std/cases.json
t/std/cases.mpac
t/std/cases_compact.mpac
t/Util.pm
diff --git a/META.yml b/META.yml
index 189b63d..494b06a 100644
--- a/META.yml
+++ b/META.yml
@@ -10,10 +10,11 @@ build_requires:
configure_requires:
Devel::PPPort: 3.19
ExtUtils::MakeMaker: 6.59
- ExtUtils::ParseXS: 2.21
+ ExtUtils::ParseXS: 3.18
+ File::Copy::Recursive: 0
distribution_type: module
dynamic_config: 1
-generated_by: 'Module::Install version 1.06'
+generated_by: 'Module::Install version 1.16'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -28,6 +29,7 @@ requires:
XSLoader: 0.02
perl: 5.8.1
resources:
+ bugtracker: https://github.com/msgpack/msgpack-perl/issues
license: http://dev.perl.org/licenses/
- repository: http://github.com/msgpack/msgpack-perl
-version: 0.48
+ repository: https://github.com/msgpack/msgpack-perl
+version: '1.00'
diff --git a/Makefile.PL b/Makefile.PL
index 0797468..c796dd7 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -7,6 +7,8 @@ use Module::Install::AuthorTests;
name 'Data-MessagePack';
all_from 'lib/Data/MessagePack.pm';
+configure_requires('File::Copy::Recursive');
+
test_requires('Test::More' => 0.94); # done_testing
test_requires('Test::Requires');
@@ -55,7 +57,8 @@ if(!$use_xs) {
test_with_env( test_pp => PERL_DATA_MESSAGEPACK => 'pp' );
-repository('http://github.com/msgpack/msgpack-perl');
+repository('https://github.com/msgpack/msgpack-perl');
+bugtracker('https://github.com/msgpack/msgpack-perl/issues');
clean_files qw{
*.stackdump
@@ -117,18 +120,37 @@ sub init_msgpack {
require File::Path;
require File::Copy;
+ require File::Copy::Recursive;
File::Path::rmtree([qw(include t/std)]);
- File::Path::mkpath([qw(include/msgpack t/std)]);
- for my $src (<msgpack/msgpack/*.h>) {
- print "AuthorMode: copy $src to include/msgpack\n";
- File::Copy::copy($src, 'include/msgpack') or die "copy failed: $!";
+ my %msgpack_header = (
+ 'include' => ['msgpack-c/include/msgpack.h'],
+ 'include/msgpack' => [<msgpack-c/include/msgpack/pack*.h>,
+ <msgpack-c/include/msgpack/unpack*.h>,
+ 'msgpack-c/include/msgpack/sysdep.h',
+ 'msgpack-c/include/msgpack/predef.h'],
+ 'include/msgpack/predef' => ['msgpack-c/include/msgpack/predef'],
+ );
+
+ while (my ($dest, $srcs) = each %msgpack_header) {
+ File::Path::mkpath([$dest]);
+
+ for my $src (@{$srcs}) {
+ next if $src =~ m/^\.\.?$/;
+ print "AuthorMode: copy $src to $dest\n";
+
+ if (-d $src) {
+ File::Copy::Recursive::dircopy($src, "$dest/") or die "copy failed: $!";
+ } else {
+ File::Copy::copy($src, $dest) or die "copy failed: $!";
+ }
+ }
}
- for my $src(<msgpack/test/*.{json,mpac}>) {
+ File::Path::mkpath([qw(t/std)]);
+ for my $src(<msgpack-c/test/*.mpac>) {
print "AuthorMode: copy $src to t/std/\n";
File::Copy::copy($src, 't/std') or die "copy failed: $!";
}
}
-
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 4ecf46b..f44ab4d 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -17,7 +17,7 @@ package Module::Install;
# 3. The ./inc/ version of Module::Install loads
# }
-use 5.005;
+use 5.006;
use strict 'vars';
use Cwd ();
use File::Find ();
@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '1.06';
+ $VERSION = '1.16';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -156,10 +156,10 @@ END_DIE
sub autoload {
my $self = shift;
my $who = $self->_caller;
- my $cwd = Cwd::cwd();
+ my $cwd = Cwd::getcwd();
my $sym = "${who}::AUTOLOAD";
$sym->{$cwd} = sub {
- my $pwd = Cwd::cwd();
+ my $pwd = Cwd::getcwd();
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
@@ -239,7 +239,7 @@ sub new {
# ignore the prefix on extension modules built from top level.
my $base_path = Cwd::abs_path($FindBin::Bin);
- unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
+ unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) {
delete $args{prefix};
}
return $args{_self} if $args{_self};
@@ -338,7 +338,7 @@ sub find_extensions {
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
my $content = Module::Install::_read($subpath . '.pm');
my $in_pod = 0;
- foreach ( split //, $content ) {
+ foreach ( split /\n/, $content ) {
$in_pod = 1 if /^=\w/;
$in_pod = 0 if /^=cut/;
next if ($in_pod || /^=cut/); # skip pod text
@@ -378,6 +378,7 @@ eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read {
local *FH;
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
+ binmode FH;
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
@@ -386,6 +387,7 @@ END_NEW
sub _read {
local *FH;
open( FH, "< $_[0]" ) or die "open($_[0]): $!";
+ binmode FH;
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
@@ -416,6 +418,7 @@ eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write {
local *FH;
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
+ binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
@@ -425,6 +428,7 @@ END_NEW
sub _write {
local *FH;
open( FH, "> $_[0]" ) or die "open($_[0]): $!";
+ binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
@@ -434,7 +438,7 @@ END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
-sub _version ($) {
+sub _version {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
@@ -450,12 +454,12 @@ sub _version ($) {
return $l + 0;
}
-sub _cmp ($$) {
+sub _cmp {
_version($_[1]) <=> _version($_[2]);
}
# Cloned from Params::Util::_CLASS
-sub _CLASS ($) {
+sub _CLASS {
(
defined $_[0]
and
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 802844a..5762a74 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.16';
}
# Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 22167b8..d859276 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index bee0c4f..41d3517 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 7052f36..e9918d2 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -133,7 +133,7 @@ sub makemaker_args {
return $args;
}
-# For mm args that take multiple space-seperated args,
+# For mm args that take multiple space-separated args,
# append an argument to the current list.
sub makemaker_append {
my $self = shift;
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 58430f3..9792685 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -347,7 +347,7 @@ sub name_from {
^ \s*
package \s*
([\w:]+)
- \s* ;
+ [\s|;]*
/ixms
) {
my ($name, $module_name) = ($1, $1);
@@ -705,7 +705,7 @@ sub _write_mymeta_data {
my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
my $meta = $yaml[0];
- # Overwrite the non-configure dependency hashs
+ # Overwrite the non-configure dependency hashes
delete $meta->{requires};
delete $meta->{build_requires};
delete $meta->{recommends};
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index eeaa3fe..218a66b 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 85d8018..530749b 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.16';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff --git a/inc/Module/Install/XSUtil.pm b/inc/Module/Install/XSUtil.pm
index afa27da..b11e6ef 100644
--- a/inc/Module/Install/XSUtil.pm
+++ b/inc/Module/Install/XSUtil.pm
@@ -3,7 +3,7 @@ package Module::Install::XSUtil;
use 5.005_03;
-$VERSION = '0.44';
+$VERSION = '0.45';
use Module::Install::Base;
@ISA = qw(Module::Install::Base);
@@ -18,7 +18,7 @@ use File::Find;
use constant _VERBOSE => $ENV{MI_VERBOSE} ? 1 : 0;
my %ConfigureRequires = (
- 'ExtUtils::ParseXS' => 2.21,
+ 'ExtUtils::ParseXS' => 3.18, # shipped with Perl 5.18.0
);
my %BuildRequires = (
diff --git a/include/msgpack.h b/include/msgpack.h
new file mode 100644
index 0000000..af557a5
--- /dev/null
+++ b/include/msgpack.h
@@ -0,0 +1,24 @@
+/*
+ * 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"
+
diff --git a/include/msgpack/pack.h b/include/msgpack/pack.h
new file mode 100644
index 0000000..2c7120f
--- /dev/null
+++ b/include/msgpack/pack.h
@@ -0,0 +1,147 @@
+/*
+ * 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 <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);
+
+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 */
diff --git a/include/msgpack/pack_define.h b/include/msgpack/pack_define.h
index 4845d52..ce98b67 100644
--- a/include/msgpack/pack_define.h
+++ b/include/msgpack/pack_define.h
@@ -3,20 +3,12 @@
*
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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__
+#ifndef MSGPACK_PACK_DEFINE_H
+#define MSGPACK_PACK_DEFINE_H
#include "msgpack/sysdep.h"
#include <limits.h>
diff --git a/include/msgpack/pack_template.h b/include/msgpack/pack_template.h
index 65c959d..17abb52 100644
--- a/include/msgpack/pack_template.h
+++ b/include/msgpack/pack_template.h
@@ -3,29 +3,23 @@
*
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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(__LITTLE_ENDIAN__)
+#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 defined(__BIG_ENDIAN__)
+#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
@@ -47,228 +41,228 @@
#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); \
- } \
+ 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); \
- } \
+ 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); \
- } \
- } \
+ 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); \
- } \
- } \
+ 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); \
- } \
+ 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); \
- } \
- } \
+ 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); \
- } \
- } \
+ 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); \
- } \
- } \
- } \
+ 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)
@@ -276,56 +270,56 @@ do { \
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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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);
+ 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
@@ -334,44 +328,66 @@ msgpack_pack_inline_func_fixint(_int64)(msgpack_pack_user x, int64_t d)
msgpack_pack_inline_func(_uint8)(msgpack_pack_user x, uint8_t d)
{
- msgpack_pack_real_uint8(x, 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_real_uint16(x, d);
}
msgpack_pack_inline_func(_uint32)(msgpack_pack_user x, uint32_t d)
{
- msgpack_pack_real_uint32(x, 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_real_uint64(x, d);
}
msgpack_pack_inline_func(_int8)(msgpack_pack_user x, int8_t d)
{
- msgpack_pack_real_int8(x, 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_real_int16(x, d);
}
msgpack_pack_inline_func(_int32)(msgpack_pack_user x, int32_t d)
{
- msgpack_pack_real_int32(x, 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_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
@@ -379,29 +395,29 @@ 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);
+ msgpack_pack_real_int16(x, d);
#elif SIZEOF_SHORT == 4
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
#else
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
#endif
#elif defined(SHRT_MAX)
#if SHRT_MAX == 0x7fff
- msgpack_pack_real_int16(x, d);
+ msgpack_pack_real_int16(x, d);
#elif SHRT_MAX == 0x7fffffff
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
#else
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
#endif
#else
if(sizeof(short) == 2) {
- msgpack_pack_real_int16(x, d);
+ msgpack_pack_real_int16(x, d);
} else if(sizeof(short) == 4) {
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
} else {
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
}
#endif
}
@@ -410,29 +426,29 @@ 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);
+ msgpack_pack_real_int16(x, d);
#elif SIZEOF_INT == 4
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
#else
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
#endif
#elif defined(INT_MAX)
#if INT_MAX == 0x7fff
- msgpack_pack_real_int16(x, d);
+ msgpack_pack_real_int16(x, d);
#elif INT_MAX == 0x7fffffff
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
#else
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
#endif
#else
if(sizeof(int) == 2) {
- msgpack_pack_real_int16(x, d);
+ msgpack_pack_real_int16(x, d);
} else if(sizeof(int) == 4) {
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
} else {
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
}
#endif
}
@@ -441,29 +457,29 @@ 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);
+ msgpack_pack_real_int16(x, d);
#elif SIZEOF_LONG == 4
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
#else
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
#endif
#elif defined(LONG_MAX)
#if LONG_MAX == 0x7fffL
- msgpack_pack_real_int16(x, d);
+ msgpack_pack_real_int16(x, d);
#elif LONG_MAX == 0x7fffffffL
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
#else
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
#endif
#else
if(sizeof(long) == 2) {
- msgpack_pack_real_int16(x, d);
+ msgpack_pack_real_int16(x, d);
} else if(sizeof(long) == 4) {
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
} else {
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
}
#endif
}
@@ -472,29 +488,29 @@ 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);
+ msgpack_pack_real_int16(x, d);
#elif SIZEOF_LONG_LONG == 4
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
#else
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
#endif
#elif defined(LLONG_MAX)
#if LLONG_MAX == 0x7fffL
- msgpack_pack_real_int16(x, d);
+ msgpack_pack_real_int16(x, d);
#elif LLONG_MAX == 0x7fffffffL
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
#else
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
#endif
#else
if(sizeof(long long) == 2) {
- msgpack_pack_real_int16(x, d);
+ msgpack_pack_real_int16(x, d);
} else if(sizeof(long long) == 4) {
- msgpack_pack_real_int32(x, d);
+ msgpack_pack_real_int32(x, d);
} else {
- msgpack_pack_real_int64(x, d);
+ msgpack_pack_real_int64(x, d);
}
#endif
}
@@ -503,29 +519,29 @@ msgpack_pack_inline_func_cint(_unsigned_short)(msgpack_pack_user x, unsigned sho
{
#if defined(SIZEOF_SHORT)
#if SIZEOF_SHORT == 2
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
#elif SIZEOF_SHORT == 4
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
#else
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
#endif
#elif defined(USHRT_MAX)
#if USHRT_MAX == 0xffffU
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
#elif USHRT_MAX == 0xffffffffU
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
#else
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
#endif
#else
if(sizeof(unsigned short) == 2) {
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
} else if(sizeof(unsigned short) == 4) {
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
} else {
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
}
#endif
}
@@ -534,29 +550,29 @@ 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);
+ msgpack_pack_real_uint16(x, d);
#elif SIZEOF_INT == 4
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
#else
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
#endif
#elif defined(UINT_MAX)
#if UINT_MAX == 0xffffU
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
#elif UINT_MAX == 0xffffffffU
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
#else
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
#endif
#else
if(sizeof(unsigned int) == 2) {
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
} else if(sizeof(unsigned int) == 4) {
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
} else {
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
}
#endif
}
@@ -565,29 +581,29 @@ msgpack_pack_inline_func_cint(_unsigned_long)(msgpack_pack_user x, unsigned long
{
#if defined(SIZEOF_LONG)
#if SIZEOF_LONG == 2
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
#elif SIZEOF_LONG == 4
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
#else
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
#endif
#elif defined(ULONG_MAX)
#if ULONG_MAX == 0xffffUL
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
#elif ULONG_MAX == 0xffffffffUL
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
#else
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
#endif
#else
if(sizeof(unsigned long) == 2) {
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
} else if(sizeof(unsigned long) == 4) {
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
} else {
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
}
#endif
}
@@ -596,29 +612,29 @@ msgpack_pack_inline_func_cint(_unsigned_long_long)(msgpack_pack_user x, unsigned
{
#if defined(SIZEOF_LONG_LONG)
#if SIZEOF_LONG_LONG == 2
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
#elif SIZEOF_LONG_LONG == 4
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
#else
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
#endif
#elif defined(ULLONG_MAX)
#if ULLONG_MAX == 0xffffUL
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
#elif ULLONG_MAX == 0xffffffffUL
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
#else
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
#endif
#else
if(sizeof(unsigned long long) == 2) {
- msgpack_pack_real_uint16(x, d);
+ msgpack_pack_real_uint16(x, d);
} else if(sizeof(unsigned long long) == 4) {
- msgpack_pack_real_uint32(x, d);
+ msgpack_pack_real_uint32(x, d);
} else {
- msgpack_pack_real_uint64(x, d);
+ msgpack_pack_real_uint64(x, d);
}
#endif
}
@@ -634,25 +650,27 @@ if(sizeof(unsigned long long) == 2) {
msgpack_pack_inline_func(_float)(msgpack_pack_user x, float d)
{
- union { float f; uint32_t i; } mem;
- mem.f = d;
- unsigned char buf[5];
- buf[0] = 0xca; _msgpack_store32(&buf[1], mem.i);
- msgpack_pack_append_buffer(x, buf, 5);
+ 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)
{
- union { double f; uint64_t i; } mem;
- mem.f = d;
- unsigned char buf[9];
- buf[0] = 0xcb;
-#if defined(__arm__) && !(__ARM_EABI__) // arm-oabi
+ 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);
+ msgpack_pack_append_buffer(x, buf, 9);
}
@@ -662,8 +680,8 @@ msgpack_pack_inline_func(_double)(msgpack_pack_user x, double d)
msgpack_pack_inline_func(_nil)(msgpack_pack_user x)
{
- static const unsigned char d = 0xc0;
- msgpack_pack_append_buffer(x, &d, 1);
+ static const unsigned char d = 0xc0;
+ msgpack_pack_append_buffer(x, &d, 1);
}
@@ -673,14 +691,14 @@ msgpack_pack_inline_func(_nil)(msgpack_pack_user x)
msgpack_pack_inline_func(_true)(msgpack_pack_user x)
{
- static const unsigned char d = 0xc3;
- msgpack_pack_append_buffer(x, &d, 1);
+ 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);
+ static const unsigned char d = 0xc2;
+ msgpack_pack_append_buffer(x, &d, 1);
}
@@ -688,20 +706,20 @@ msgpack_pack_inline_func(_false)(msgpack_pack_user x)
* Array
*/
-msgpack_pack_inline_func(_array)(msgpack_pack_user x, unsigned int n)
+msgpack_pack_inline_func(_array)(msgpack_pack_user x, size_t n)
{
- if(n < 16) {
- unsigned char d = 0x90 | 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);
- }
+ 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);
+ }
}
@@ -709,46 +727,167 @@ msgpack_pack_inline_func(_array)(msgpack_pack_user x, unsigned int n)
* Map
*/
-msgpack_pack_inline_func(_map)(msgpack_pack_user x, unsigned int n)
+msgpack_pack_inline_func(_map)(msgpack_pack_user x, size_t n)
{
- if(n < 16) {
- unsigned char d = 0x80 | 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);
- }
+ 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);
+ }
}
/*
- * Raw
+ * Str
*/
-msgpack_pack_inline_func(_raw)(msgpack_pack_user x, size_t l)
+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 < 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);
- }
+ 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(_raw_body)(msgpack_pack_user x, const void* b, size_t l)
+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);
+ 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);
}
#undef msgpack_pack_inline_func
@@ -768,4 +907,3 @@ msgpack_pack_inline_func(_raw_body)(msgpack_pack_user x, const void* b, size_t l
#undef msgpack_pack_real_int16
#undef msgpack_pack_real_int32
#undef msgpack_pack_real_int64
-
diff --git a/include/msgpack/predef.h b/include/msgpack/predef.h
new file mode 100644
index 0000000..e53ceac
--- /dev/null
+++ b/include/msgpack/predef.h
@@ -0,0 +1,19 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_H
+#define MSGPACK_PREDEF_H
+
+#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>
+
+#endif
diff --git a/include/msgpack/predef/architecture.h b/include/msgpack/predef/architecture.h
new file mode 100644
index 0000000..dc9a5a5
--- /dev/null
+++ b/include/msgpack/predef/architecture.h
@@ -0,0 +1,30 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_H
+#define MSGPACK_PREDEF_ARCHITECTURE_H
+
+#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
diff --git a/include/msgpack/predef/architecture/alpha.h b/include/msgpack/predef/architecture/alpha.h
new file mode 100644
index 0000000..9fe469c
--- /dev/null
+++ b/include/msgpack/predef/architecture/alpha.h
@@ -0,0 +1,60 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_ALPHA,MSGPACK_ARCH_ALPHA_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/arm.h b/include/msgpack/predef/architecture/arm.h
new file mode 100644
index 0000000..ccb175e
--- /dev/null
+++ b/include/msgpack/predef/architecture/arm.h
@@ -0,0 +1,71 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_ARM,MSGPACK_ARCH_ARM_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/blackfin.h b/include/msgpack/predef/architecture/blackfin.h
new file mode 100644
index 0000000..688feaa
--- /dev/null
+++ b/include/msgpack/predef/architecture/blackfin.h
@@ -0,0 +1,47 @@
+/*
+Copyright Rene Rivera 2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_BLACKFIN,MSGPACK_ARCH_BLACKFIN_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/convex.h b/include/msgpack/predef/architecture/convex.h
new file mode 100644
index 0000000..f209dcc
--- /dev/null
+++ b/include/msgpack/predef/architecture/convex.h
@@ -0,0 +1,67 @@
+/*
+Copyright Rene Rivera 2011-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_CONVEX,MSGPACK_ARCH_CONVEX_NAME)
+
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/ia64.h b/include/msgpack/predef/architecture/ia64.h
new file mode 100644
index 0000000..a33f1e9
--- /dev/null
+++ b/include/msgpack/predef/architecture/ia64.h
@@ -0,0 +1,49 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_IA64,MSGPACK_ARCH_IA64_NAME)
+
+#endif
diff --git a/include/msgpack/predef/architecture/m68k.h b/include/msgpack/predef/architecture/m68k.h
new file mode 100644
index 0000000..5c530d5
--- /dev/null
+++ b/include/msgpack/predef/architecture/m68k.h
@@ -0,0 +1,83 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_M68K,MSGPACK_ARCH_M68K_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/mips.h b/include/msgpack/predef/architecture/mips.h
new file mode 100644
index 0000000..2559e71
--- /dev/null
+++ b/include/msgpack/predef/architecture/mips.h
@@ -0,0 +1,74 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_MIPS,MSGPACK_ARCH_MIPS_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/parisc.h b/include/msgpack/predef/architecture/parisc.h
new file mode 100644
index 0000000..f6b575b
--- /dev/null
+++ b/include/msgpack/predef/architecture/parisc.h
@@ -0,0 +1,65 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PARISC,MSGPACK_ARCH_PARISC_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/ppc.h b/include/msgpack/predef/architecture/ppc.h
new file mode 100644
index 0000000..a62d604
--- /dev/null
+++ b/include/msgpack/predef/architecture/ppc.h
@@ -0,0 +1,73 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PPC,MSGPACK_ARCH_PPC_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/pyramid.h b/include/msgpack/predef/architecture/pyramid.h
new file mode 100644
index 0000000..b61323b
--- /dev/null
+++ b/include/msgpack/predef/architecture/pyramid.h
@@ -0,0 +1,43 @@
+/*
+Copyright Rene Rivera 2011-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_PYRAMID,MSGPACK_ARCH_PYRAMID_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/rs6k.h b/include/msgpack/predef/architecture/rs6k.h
new file mode 100644
index 0000000..78b87b5
--- /dev/null
+++ b/include/msgpack/predef/architecture/rs6k.h
@@ -0,0 +1,56 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_RS6000,MSGPACK_ARCH_RS6000_NAME)
+
+#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
diff --git a/include/msgpack/predef/architecture/sparc.h b/include/msgpack/predef/architecture/sparc.h
new file mode 100644
index 0000000..5b52db1
--- /dev/null
+++ b/include/msgpack/predef/architecture/sparc.h
@@ -0,0 +1,55 @@
+/*
+Copyright Rene Rivera 2008-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_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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SPARC,MSGPACK_ARCH_SPARC_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/superh.h b/include/msgpack/predef/architecture/superh.h
new file mode 100644
index 0000000..bba6a2f
--- /dev/null
+++ b/include/msgpack/predef/architecture/superh.h
@@ -0,0 +1,68 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SH,MSGPACK_ARCH_SH_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/sys370.h b/include/msgpack/predef/architecture/sys370.h
new file mode 100644
index 0000000..ddb7f04
--- /dev/null
+++ b/include/msgpack/predef/architecture/sys370.h
@@ -0,0 +1,44 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SYS370,MSGPACK_ARCH_SYS370_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/sys390.h b/include/msgpack/predef/architecture/sys390.h
new file mode 100644
index 0000000..029214f
--- /dev/null
+++ b/include/msgpack/predef/architecture/sys390.h
@@ -0,0 +1,44 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_SYS390,MSGPACK_ARCH_SYS390_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/architecture/x86.h b/include/msgpack/predef/architecture/x86.h
new file mode 100644
index 0000000..109d9d9
--- /dev/null
+++ b/include/msgpack/predef/architecture/x86.h
@@ -0,0 +1,38 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_H
+#define MSGPACK_PREDEF_ARCHITECTURE_X86_H
+
+#include <msgpack/predef/architecture/x86/32.h>
+#include <msgpack/predef/architecture/x86/64.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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_X86,MSGPACK_ARCH_X86_NAME)
+
+#endif
diff --git a/include/msgpack/predef/architecture/x86/32.h b/include/msgpack/predef/architecture/x86/32.h
new file mode 100644
index 0000000..ce6639d
--- /dev/null
+++ b/include/msgpack/predef/architecture/x86/32.h
@@ -0,0 +1,87 @@
+/*
+Copyright Rene Rivera 2008-2013
+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/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_X86_32,MSGPACK_ARCH_X86_32_NAME)
+
+#include <msgpack/predef/architecture/x86.h>
+
+#endif
diff --git a/include/msgpack/predef/architecture/x86/64.h b/include/msgpack/predef/architecture/x86/64.h
new file mode 100644
index 0000000..d6d65ef
--- /dev/null
+++ b/include/msgpack/predef/architecture/x86/64.h
@@ -0,0 +1,50 @@
+/*
+Copyright Rene Rivera 2008-2013
+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/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_X86_64,MSGPACK_ARCH_X86_64_NAME)
+
+#include <msgpack/predef/architecture/x86.h>
+
+#endif
diff --git a/include/msgpack/predef/architecture/z.h b/include/msgpack/predef/architecture/z.h
new file mode 100644
index 0000000..f8479f2
--- /dev/null
+++ b/include/msgpack/predef/architecture/z.h
@@ -0,0 +1,43 @@
+/*
+Copyright Rene Rivera 2008-2013
+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"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ARCH_Z,MSGPACK_ARCH_Z_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/compiler.h b/include/msgpack/predef/compiler.h
new file mode 100644
index 0000000..08dec96
--- /dev/null
+++ b/include/msgpack/predef/compiler.h
@@ -0,0 +1,41 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_H
+#define MSGPACK_PREDEF_COMPILER_H
+
+#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
diff --git a/include/msgpack/predef/compiler/borland.h b/include/msgpack/predef/compiler/borland.h
new file mode 100644
index 0000000..724a8e7
--- /dev/null
+++ b/include/msgpack/predef/compiler/borland.h
@@ -0,0 +1,64 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/clang.h b/include/msgpack/predef/compiler/clang.h
new file mode 100644
index 0000000..ded61ce
--- /dev/null
+++ b/include/msgpack/predef/compiler/clang.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-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_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"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/comeau.h b/include/msgpack/predef/compiler/comeau.h
new file mode 100644
index 0000000..305517d
--- /dev/null
+++ b/include/msgpack/predef/compiler/comeau.h
@@ -0,0 +1,62 @@
+/*
+Copyright Rene Rivera 2008-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_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(__CONO_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/compaq.h b/include/msgpack/predef/compiler/compaq.h
new file mode 100644
index 0000000..6755961
--- /dev/null
+++ b/include/msgpack/predef/compiler/compaq.h
@@ -0,0 +1,67 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/diab.h b/include/msgpack/predef/compiler/diab.h
new file mode 100644
index 0000000..8b2b584
--- /dev/null
+++ b/include/msgpack/predef/compiler/diab.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/digitalmars.h b/include/msgpack/predef/compiler/digitalmars.h
new file mode 100644
index 0000000..c50d4fd
--- /dev/null
+++ b/include/msgpack/predef/compiler/digitalmars.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-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_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"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/dignus.h b/include/msgpack/predef/compiler/dignus.h
new file mode 100644
index 0000000..f5161cc
--- /dev/null
+++ b/include/msgpack/predef/compiler/dignus.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/edg.h b/include/msgpack/predef/compiler/edg.h
new file mode 100644
index 0000000..5284243
--- /dev/null
+++ b/include/msgpack/predef/compiler/edg.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-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_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"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/ekopath.h b/include/msgpack/predef/compiler/ekopath.h
new file mode 100644
index 0000000..2385966
--- /dev/null
+++ b/include/msgpack/predef/compiler/ekopath.h
@@ -0,0 +1,58 @@
+/*
+Copyright Rene Rivera 2008-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_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"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/gcc.h b/include/msgpack/predef/compiler/gcc.h
new file mode 100644
index 0000000..95f5729
--- /dev/null
+++ b/include/msgpack/predef/compiler/gcc.h
@@ -0,0 +1,69 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/gcc_xml.h b/include/msgpack/predef/compiler/gcc_xml.h
new file mode 100644
index 0000000..8dd4ff7
--- /dev/null
+++ b/include/msgpack/predef/compiler/gcc_xml.h
@@ -0,0 +1,53 @@
+/*
+Copyright Rene Rivera 2008-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_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"
+
+#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
+
+#endif
diff --git a/include/msgpack/predef/compiler/greenhills.h b/include/msgpack/predef/compiler/greenhills.h
new file mode 100644
index 0000000..7ccab8b
--- /dev/null
+++ b/include/msgpack/predef/compiler/greenhills.h
@@ -0,0 +1,67 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/hp_acc.h b/include/msgpack/predef/compiler/hp_acc.h
new file mode 100644
index 0000000..c31e6fa
--- /dev/null
+++ b/include/msgpack/predef/compiler/hp_acc.h
@@ -0,0 +1,62 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/iar.h b/include/msgpack/predef/compiler/iar.h
new file mode 100644
index 0000000..65614bb
--- /dev/null
+++ b/include/msgpack/predef/compiler/iar.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/ibm.h b/include/msgpack/predef/compiler/ibm.h
new file mode 100644
index 0000000..346db81
--- /dev/null
+++ b/include/msgpack/predef/compiler/ibm.h
@@ -0,0 +1,73 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/intel.h b/include/msgpack/predef/compiler/intel.h
new file mode 100644
index 0000000..ed3e4bc
--- /dev/null
+++ b/include/msgpack/predef/compiler/intel.h
@@ -0,0 +1,66 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/kai.h b/include/msgpack/predef/compiler/kai.h
new file mode 100644
index 0000000..b7b701d
--- /dev/null
+++ b/include/msgpack/predef/compiler/kai.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-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_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++"
+
+#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
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/llvm.h b/include/msgpack/predef/compiler/llvm.h
new file mode 100644
index 0000000..cc2b834
--- /dev/null
+++ b/include/msgpack/predef/compiler/llvm.h
@@ -0,0 +1,58 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_LLVM_H
+#define MSGPACK_PREDEF_COMPILER_LLVM_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_LLVM`]
+
+[@http://en.wikipedia.org/wiki/LLVM LLVM] compiler.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__llvm__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_COMP_LLVM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__llvm__)
+# define MSGPACK_COMP_LLVM_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#ifdef MSGPACK_COMP_LLVM_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_LLVM_EMULATED MSGPACK_COMP_LLVM_DETECTION
+# else
+# undef MSGPACK_COMP_LLVM
+# define MSGPACK_COMP_LLVM MSGPACK_COMP_LLVM_DETECTION
+# endif
+# define MSGPACK_COMP_LLVM_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_LLVM_NAME "LLVM"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_LLVM,MSGPACK_COMP_LLVM_NAME)
+
+#ifdef MSGPACK_COMP_LLVM_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_LLVM_EMULATED,MSGPACK_COMP_LLVM_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/metaware.h b/include/msgpack/predef/compiler/metaware.h
new file mode 100644
index 0000000..0d9d04b
--- /dev/null
+++ b/include/msgpack/predef/compiler/metaware.h
@@ -0,0 +1,54 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_METAWARE_H
+#define MSGPACK_PREDEF_COMPILER_METAWARE_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_HIGHC`]
+
+MetaWare High C/C++ compiler.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__HIGHC__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_COMP_HIGHC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__HIGHC__)
+# define MSGPACK_COMP_HIGHC_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#ifdef MSGPACK_COMP_HIGHC_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_HIGHC_EMULATED MSGPACK_COMP_HIGHC_DETECTION
+# else
+# undef MSGPACK_COMP_HIGHC
+# define MSGPACK_COMP_HIGHC MSGPACK_COMP_HIGHC_DETECTION
+# endif
+# define MSGPACK_COMP_HIGHC_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_HIGHC_NAME "MetaWare High C/C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_HIGHC,MSGPACK_COMP_HIGHC_NAME)
+
+#ifdef MSGPACK_COMP_HIGHC_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_HIGHC_EMULATED,MSGPACK_COMP_HIGHC_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/metrowerks.h b/include/msgpack/predef/compiler/metrowerks.h
new file mode 100644
index 0000000..7162cc7
--- /dev/null
+++ b/include/msgpack/predef/compiler/metrowerks.h
@@ -0,0 +1,78 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_METROWERKS_H
+#define MSGPACK_PREDEF_COMPILER_METROWERKS_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_MWERKS`]
+
+[@http://en.wikipedia.org/wiki/CodeWarrior Metrowerks CodeWarrior] compiler.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__MWERKS__`] [__predef_detection__]]
+ [[`__CWCC__`] [__predef_detection__]]
+
+ [[`__CWCC__`] [V.R.P]]
+ [[`__MWERKS__`] [V.R.P >= 4.2.0]]
+ [[`__MWERKS__`] [9.R.0]]
+ [[`__MWERKS__`] [8.R.0]]
+ ]
+ */
+
+#define MSGPACK_COMP_MWERKS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__MWERKS__) || defined(__CWCC__)
+# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && defined(__CWCC__)
+# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_PREDEF_MAKE_0X_VRPP(__CWCC__)
+# endif
+# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && (__MWERKS__ >= 0x4200)
+# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_PREDEF_MAKE_0X_VRPP(__MWERKS__)
+# endif
+# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && (__MWERKS__ >= 0x3204) // note the "skip": 04->9.3
+# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_VERSION_NUMBER(9,(__MWERKS__)%100-1,0)
+# endif
+# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && (__MWERKS__ >= 0x3200)
+# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_VERSION_NUMBER(9,(__MWERKS__)%100,0)
+# endif
+# if !defined(MSGPACK_COMP_MWERKS_DETECTION) && (__MWERKS__ >= 0x3000)
+# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_VERSION_NUMBER(8,(__MWERKS__)%100,0)
+# endif
+# if !defined(MSGPACK_COMP_MWERKS_DETECTION)
+# define MSGPACK_COMP_MWERKS_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#ifdef MSGPACK_COMP_MWERKS_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_MWERKS_EMULATED MSGPACK_COMP_MWERKS_DETECTION
+# else
+# undef MSGPACK_COMP_MWERKS
+# define MSGPACK_COMP_MWERKS MSGPACK_COMP_MWERKS_DETECTION
+# endif
+# define MSGPACK_COMP_MWERKS_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_MWERKS_NAME "Metrowerks CodeWarrior"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MWERKS,MSGPACK_COMP_MWERKS_NAME)
+
+#ifdef MSGPACK_COMP_MWERKS_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MWERKS_EMULATED,MSGPACK_COMP_MWERKS_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/microtec.h b/include/msgpack/predef/compiler/microtec.h
new file mode 100644
index 0000000..f6942f2
--- /dev/null
+++ b/include/msgpack/predef/compiler/microtec.h
@@ -0,0 +1,54 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_MICROTEC_H
+#define MSGPACK_PREDEF_COMPILER_MICROTEC_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_MRI`]
+
+[@http://www.mentor.com/microtec/ Microtec C/C++] compiler.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`_MRI`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_COMP_MRI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(_MRI)
+# define MSGPACK_COMP_MRI_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#ifdef MSGPACK_COMP_MRI_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_MRI_EMULATED MSGPACK_COMP_MRI_DETECTION
+# else
+# undef MSGPACK_COMP_MRI
+# define MSGPACK_COMP_MRI MSGPACK_COMP_MRI_DETECTION
+# endif
+# define MSGPACK_COMP_MRI_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_MRI_NAME "Microtec C/C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MRI,MSGPACK_COMP_MRI_NAME)
+
+#ifdef MSGPACK_COMP_MRI_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MRI_EMULATED,MSGPACK_COMP_MRI_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/mpw.h b/include/msgpack/predef/compiler/mpw.h
new file mode 100644
index 0000000..cef0ace
--- /dev/null
+++ b/include/msgpack/predef/compiler/mpw.h
@@ -0,0 +1,64 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_MPW_H
+#define MSGPACK_PREDEF_COMPILER_MPW_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_MPW`]
+
+[@http://en.wikipedia.org/wiki/Macintosh_Programmer%27s_Workshop MPW C++] compiler.
+Version number available as major, and minor.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__MRC__`] [__predef_detection__]]
+ [[`MPW_C`] [__predef_detection__]]
+ [[`MPW_CPLUS`] [__predef_detection__]]
+
+ [[`__MRC__`] [V.R.0]]
+ ]
+ */
+
+#define MSGPACK_COMP_MPW MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__MRC__) || defined(MPW_C) || defined(MPW_CPLUS)
+# if !defined(MSGPACK_COMP_MPW_DETECTION) && defined(__MRC__)
+# define MSGPACK_COMP_MPW_DETECTION MSGPACK_PREDEF_MAKE_0X_VVRR(__MRC__)
+# endif
+# if !defined(MSGPACK_COMP_MPW_DETECTION)
+# define MSGPACK_COMP_MPW_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#ifdef MSGPACK_COMP_MPW_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_MPW_EMULATED MSGPACK_COMP_MPW_DETECTION
+# else
+# undef MSGPACK_COMP_MPW
+# define MSGPACK_COMP_MPW MSGPACK_COMP_MPW_DETECTION
+# endif
+# define MSGPACK_COMP_MPW_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_MPW_NAME "MPW C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MPW,MSGPACK_COMP_MPW_NAME)
+
+#ifdef MSGPACK_COMP_MPW_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MPW_EMULATED,MSGPACK_COMP_MPW_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/palm.h b/include/msgpack/predef/compiler/palm.h
new file mode 100644
index 0000000..d3a960e
--- /dev/null
+++ b/include/msgpack/predef/compiler/palm.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_PALM_H
+#define MSGPACK_PREDEF_COMPILER_PALM_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_PALM`]
+
+Palm C/C++ compiler.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`_PACC_VER`] [__predef_detection__]]
+
+ [[`_PACC_VER`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_COMP_PALM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(_PACC_VER)
+# define MSGPACK_COMP_PALM_DETECTION MSGPACK_PREDEF_MAKE_0X_VRRPP000(_PACC_VER)
+#endif
+
+#ifdef MSGPACK_COMP_PALM_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_PALM_EMULATED MSGPACK_COMP_PALM_DETECTION
+# else
+# undef MSGPACK_COMP_PALM
+# define MSGPACK_COMP_PALM MSGPACK_COMP_PALM_DETECTION
+# endif
+# define MSGPACK_COMP_PALM_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_PALM_NAME "Palm C/C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PALM,MSGPACK_COMP_PALM_NAME)
+
+#ifdef MSGPACK_COMP_PALM_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PALM_EMULATED,MSGPACK_COMP_PALM_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/pgi.h b/include/msgpack/predef/compiler/pgi.h
new file mode 100644
index 0000000..8bf5086
--- /dev/null
+++ b/include/msgpack/predef/compiler/pgi.h
@@ -0,0 +1,61 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_PGI_H
+#define MSGPACK_PREDEF_COMPILER_PGI_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_PGI`]
+
+[@http://en.wikipedia.org/wiki/The_Portland_Group Portland Group C/C++] compiler.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__PGI`] [__predef_detection__]]
+
+ [[`__PGIC__`, `__PGIC_MINOR__`, `__PGIC_PATCHLEVEL__`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_COMP_PGI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__PGI)
+# if !defined(MSGPACK_COMP_PGI_DETECTION) && (defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__))
+# define MSGPACK_COMP_PGI_DETECTION MSGPACK_VERSION_NUMBER(__PGIC__,__PGIC_MINOR__,__PGIC_PATCHLEVEL__)
+# endif
+# if !defined(MSGPACK_COMP_PGI_DETECTION)
+# define MSGPACK_COMP_PGI_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#ifdef MSGPACK_COMP_PGI_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_PGI_EMULATED MSGPACK_COMP_PGI_DETECTION
+# else
+# undef MSGPACK_COMP_PGI
+# define MSGPACK_COMP_PGI MSGPACK_COMP_PGI_DETECTION
+# endif
+# define MSGPACK_COMP_PGI_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_PGI_NAME "Portland Group C/C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PGI,MSGPACK_COMP_PGI_NAME)
+
+#ifdef MSGPACK_COMP_PGI_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_PGI_EMULATED,MSGPACK_COMP_PGI_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/sgi_mipspro.h b/include/msgpack/predef/compiler/sgi_mipspro.h
new file mode 100644
index 0000000..4e1b00b
--- /dev/null
+++ b/include/msgpack/predef/compiler/sgi_mipspro.h
@@ -0,0 +1,67 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_SGI_MIPSPRO_H
+#define MSGPACK_PREDEF_COMPILER_SGI_MIPSPRO_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_SGI`]
+
+[@http://en.wikipedia.org/wiki/MIPSpro SGI MIPSpro] compiler.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__sgi`] [__predef_detection__]]
+ [[`sgi`] [__predef_detection__]]
+
+ [[`_SGI_COMPILER_VERSION`] [V.R.P]]
+ [[`_COMPILER_VERSION`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_COMP_SGI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__sgi) || defined(sgi)
+# if !defined(MSGPACK_COMP_SGI_DETECTION) && defined(_SGI_COMPILER_VERSION)
+# define MSGPACK_COMP_SGI_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(_SGI_COMPILER_VERSION)
+# endif
+# if !defined(MSGPACK_COMP_SGI_DETECTION) && defined(_COMPILER_VERSION)
+# define MSGPACK_COMP_SGI_DETECTION MSGPACK_PREDEF_MAKE_10_VRP(_COMPILER_VERSION)
+# endif
+# if !defined(MSGPACK_COMP_SGI_DETECTION)
+# define MSGPACK_COMP_SGI_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#ifdef MSGPACK_COMP_SGI_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_SGI_EMULATED MSGPACK_COMP_SGI_DETECTION
+# else
+# undef MSGPACK_COMP_SGI
+# define MSGPACK_COMP_SGI MSGPACK_COMP_SGI_DETECTION
+# endif
+# define MSGPACK_COMP_SGI_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_SGI_NAME "SGI MIPSpro"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SGI,MSGPACK_COMP_SGI_NAME)
+
+#ifdef MSGPACK_COMP_SGI_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SGI_EMULATED,MSGPACK_COMP_SGI_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/sunpro.h b/include/msgpack/predef/compiler/sunpro.h
new file mode 100644
index 0000000..26e9513
--- /dev/null
+++ b/include/msgpack/predef/compiler/sunpro.h
@@ -0,0 +1,67 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_SUNPRO_H
+#define MSGPACK_PREDEF_COMPILER_SUNPRO_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_SUNPRO`]
+
+[@http://en.wikipedia.org/wiki/Sun_Studio_%28software%29 Sun Studio] compiler.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__SUNPRO_CC`] [__predef_detection__]]
+ [[`__SUNPRO_C`] [__predef_detection__]]
+
+ [[`__SUNPRO_CC`] [V.R.P]]
+ [[`__SUNPRO_C`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_COMP_SUNPRO MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
+# if !defined(MSGPACK_COMP_SUNPRO_DETECTION) && defined(__SUNPRO_CC)
+# define MSGPACK_COMP_SUNPRO_DETECTION MSGPACK_PREDEF_MAKE_0X_VRP(__SUNPRO_CC)
+# endif
+# if !defined(MSGPACK_COMP_SUNPRO_DETECTION) && defined(__SUNPRO_C)
+# define MSGPACK_COMP_SUNPRO_DETECTION MSGPACK_PREDEF_MAKE_0X_VRP(__SUNPRO_C)
+# endif
+# if !defined(MSGPACK_COMP_SUNPRO_DETECTION)
+# define MSGPACK_COMP_SUNPRO_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#ifdef MSGPACK_COMP_SUNPRO_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_SUNPRO_EMULATED MSGPACK_COMP_SUNPRO_DETECTION
+# else
+# undef MSGPACK_COMP_SUNPRO
+# define MSGPACK_COMP_SUNPRO MSGPACK_COMP_SUNPRO_DETECTION
+# endif
+# define MSGPACK_COMP_SUNPRO_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_SUNPRO_NAME "Sun Studio"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SUNPRO,MSGPACK_COMP_SUNPRO_NAME)
+
+#ifdef MSGPACK_COMP_SUNPRO_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_SUNPRO_EMULATED,MSGPACK_COMP_SUNPRO_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/tendra.h b/include/msgpack/predef/compiler/tendra.h
new file mode 100644
index 0000000..7eaa3c9
--- /dev/null
+++ b/include/msgpack/predef/compiler/tendra.h
@@ -0,0 +1,54 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_TENDRA_H
+#define MSGPACK_PREDEF_COMPILER_TENDRA_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_TENDRA`]
+
+[@http://en.wikipedia.org/wiki/TenDRA_Compiler TenDRA C/C++] compiler.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__TenDRA__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_COMP_TENDRA MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__TenDRA__)
+# define MSGPACK_COMP_TENDRA_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#ifdef MSGPACK_COMP_TENDRA_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_TENDRA_EMULATED MSGPACK_COMP_TENDRA_DETECTION
+# else
+# undef MSGPACK_COMP_TENDRA
+# define MSGPACK_COMP_TENDRA MSGPACK_COMP_TENDRA_DETECTION
+# endif
+# define MSGPACK_COMP_TENDRA_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_TENDRA_NAME "TenDRA C/C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_TENDRA,MSGPACK_COMP_TENDRA_NAME)
+
+#ifdef MSGPACK_COMP_TENDRA_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_TENDRA_EMULATED,MSGPACK_COMP_TENDRA_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/visualc.h b/include/msgpack/predef/compiler/visualc.h
new file mode 100644
index 0000000..943dd00
--- /dev/null
+++ b/include/msgpack/predef/compiler/visualc.h
@@ -0,0 +1,92 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_VISUALC_H
+#define MSGPACK_PREDEF_COMPILER_VISUALC_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_MSVC`]
+
+[@http://en.wikipedia.org/wiki/Visual_studio Microsoft Visual C/C++] compiler.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`_MSC_VER`] [__predef_detection__]]
+
+ [[`_MSC_FULL_VER`] [V.R.P]]
+ [[`_MSC_VER`] [V.R.0]]
+ ]
+ */
+
+#define MSGPACK_COMP_MSVC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(_MSC_VER)
+# if !defined (_MSC_FULL_VER)
+# define MSGPACK_COMP_MSVC_BUILD 0
+# else
+ /* how many digits does the build number have? */
+# if _MSC_FULL_VER / 10000 == _MSC_VER
+ /* four digits */
+# define MSGPACK_COMP_MSVC_BUILD (_MSC_FULL_VER % 10000)
+# elif _MSC_FULL_VER / 100000 == _MSC_VER
+ /* five digits */
+# define MSGPACK_COMP_MSVC_BUILD (_MSC_FULL_VER % 100000)
+# else
+# error "Cannot determine build number from _MSC_FULL_VER"
+# endif
+# endif
+ /*
+ VS2014 was skipped in the release sequence for MS. Which
+ means that the compiler and VS product versions are no longer
+ in sync. Hence we need to use different formulas for
+ mapping from MSC version to VS product version.
+ */
+# if (_MSC_VER >= 1900)
+# define MSGPACK_COMP_MSVC_DETECTION MSGPACK_VERSION_NUMBER(\
+ _MSC_VER/100-5,\
+ _MSC_VER%100,\
+ MSGPACK_COMP_MSVC_BUILD)
+# else
+# define MSGPACK_COMP_MSVC_DETECTION MSGPACK_VERSION_NUMBER(\
+ _MSC_VER/100-6,\
+ _MSC_VER%100,\
+ MSGPACK_COMP_MSVC_BUILD)
+# endif
+#endif
+
+#ifdef MSGPACK_COMP_MSVC_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_MSVC_EMULATED MSGPACK_COMP_MSVC_DETECTION
+# else
+# undef MSGPACK_COMP_MSVC
+# define MSGPACK_COMP_MSVC MSGPACK_COMP_MSVC_DETECTION
+# endif
+# define MSGPACK_COMP_MSVC_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_MSVC_NAME "Microsoft Visual C/C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MSVC,MSGPACK_COMP_MSVC_NAME)
+
+#ifdef MSGPACK_COMP_MSVC_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_MSVC_EMULATED,MSGPACK_COMP_MSVC_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/compiler/watcom.h b/include/msgpack/predef/compiler/watcom.h
new file mode 100644
index 0000000..705d041
--- /dev/null
+++ b/include/msgpack/predef/compiler/watcom.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-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_COMPILER_WATCOM_H
+#define MSGPACK_PREDEF_COMPILER_WATCOM_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_COMP_WATCOM`]
+
+[@http://en.wikipedia.org/wiki/Watcom Watcom C++] compiler.
+Version number available as major, and minor.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__WATCOMC__`] [__predef_detection__]]
+
+ [[`__WATCOMC__`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_COMP_WATCOM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__WATCOMC__)
+# define MSGPACK_COMP_WATCOM_DETECTION MSGPACK_PREDEF_MAKE_10_VVRR(__WATCOMC__)
+#endif
+
+#ifdef MSGPACK_COMP_WATCOM_DETECTION
+# if defined(MSGPACK_PREDEF_DETAIL_COMP_DETECTED)
+# define MSGPACK_COMP_WATCOM_EMULATED MSGPACK_COMP_WATCOM_DETECTION
+# else
+# undef MSGPACK_COMP_WATCOM
+# define MSGPACK_COMP_WATCOM MSGPACK_COMP_WATCOM_DETECTION
+# endif
+# define MSGPACK_COMP_WATCOM_AVAILABLE
+# include <msgpack/predef/detail/comp_detected.h>
+#endif
+
+#define MSGPACK_COMP_WATCOM_NAME "Watcom C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_WATCOM,MSGPACK_COMP_WATCOM_NAME)
+
+#ifdef MSGPACK_COMP_WATCOM_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_COMP_WATCOM_EMULATED,MSGPACK_COMP_WATCOM_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/detail/_cassert.h b/include/msgpack/predef/detail/_cassert.h
new file mode 100644
index 0000000..b1cb6bc
--- /dev/null
+++ b/include/msgpack/predef/detail/_cassert.h
@@ -0,0 +1,17 @@
+/*
+Copyright Rene Rivera 2011-2012
+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_DETAIL__CASSERT_H
+#define MSGPACK_PREDEF_DETAIL__CASSERT_H
+
+#if defined(__cpluplus)
+#include <cassert>
+#else
+#include <assert.h>
+#endif
+
+#endif
diff --git a/include/msgpack/predef/detail/_exception.h b/include/msgpack/predef/detail/_exception.h
new file mode 100644
index 0000000..963f37b
--- /dev/null
+++ b/include/msgpack/predef/detail/_exception.h
@@ -0,0 +1,15 @@
+/*
+Copyright Rene Rivera 2011-2012
+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_DETAIL__EXCEPTION_H
+#define MSGPACK_PREDEF_DETAIL__EXCEPTION_H
+
+#if defined(__cpluplus)
+#include <exception>
+#endif
+
+#endif
diff --git a/include/msgpack/predef/detail/comp_detected.h b/include/msgpack/predef/detail/comp_detected.h
new file mode 100644
index 0000000..3996fd3
--- /dev/null
+++ b/include/msgpack/predef/detail/comp_detected.h
@@ -0,0 +1,10 @@
+/*
+Copyright Rene Rivera 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_DETAIL_COMP_DETECTED
+#define MSGPACK_PREDEF_DETAIL_COMP_DETECTED 1
+#endif
diff --git a/include/msgpack/predef/detail/endian_compat.h b/include/msgpack/predef/detail/endian_compat.h
new file mode 100644
index 0000000..1b4a665
--- /dev/null
+++ b/include/msgpack/predef/detail/endian_compat.h
@@ -0,0 +1,26 @@
+/*
+Copyright Rene Rivera 2013
+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_DETAIL_ENDIAN_COMPAT_H
+#define MSGPACK_PREDEF_DETAIL_ENDIAN_COMPAT_H
+
+#include <msgpack/predef/other/endian.h>
+
+#if MSGPACK_ENDIAN_BIG_BYTE
+# define MSGPACK_BIG_ENDIAN
+# define MSGPACK_BYTE_ORDER 4321
+#endif
+#if MSGPACK_ENDIAN_LITTLE_BYTE
+# define MSGPACK_LITTLE_ENDIAN
+# define MSGPACK_BYTE_ORDER 1234
+#endif
+#if MSGPACK_ENDIAN_LITTLE_WORD
+# define MSGPACK_PDP_ENDIAN
+# define MSGPACK_BYTE_ORDER 2134
+#endif
+
+#endif
diff --git a/include/msgpack/predef/detail/os_detected.h b/include/msgpack/predef/detail/os_detected.h
new file mode 100644
index 0000000..f9f23b7
--- /dev/null
+++ b/include/msgpack/predef/detail/os_detected.h
@@ -0,0 +1,10 @@
+/*
+Copyright Rene Rivera 2013
+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_DETAIL_OS_DETECTED
+#define MSGPACK_PREDEF_DETAIL_OS_DETECTED 1
+#endif
diff --git a/include/msgpack/predef/detail/platform_detected.h b/include/msgpack/predef/detail/platform_detected.h
new file mode 100644
index 0000000..782b3a2
--- /dev/null
+++ b/include/msgpack/predef/detail/platform_detected.h
@@ -0,0 +1,10 @@
+/*
+Copyright Rene Rivera 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_DETAIL_PLAT_DETECTED
+#define MSGPACK_PREDEF_DETAIL_PLAT_DETECTED 1
+#endif
diff --git a/include/msgpack/predef/detail/test.h b/include/msgpack/predef/detail/test.h
new file mode 100644
index 0000000..1414060
--- /dev/null
+++ b/include/msgpack/predef/detail/test.h
@@ -0,0 +1,17 @@
+/*
+Copyright Rene Rivera 2011-2012
+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_DETAIL_TEST_H
+#define MSGPACK_PREDEF_DETAIL_TEST_H
+
+#if !defined(MSGPACK_PREDEF_INTERNAL_GENERATE_TESTS)
+
+#define MSGPACK_PREDEF_DECLARE_TEST(x,s)
+
+#endif
+
+#endif
diff --git a/include/msgpack/predef/language.h b/include/msgpack/predef/language.h
new file mode 100644
index 0000000..8520187
--- /dev/null
+++ b/include/msgpack/predef/language.h
@@ -0,0 +1,15 @@
+/*
+Copyright Rene Rivera 2011-2012
+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_LANGUAGE_H
+#define MSGPACK_PREDEF_LANGUAGE_H
+
+#include <msgpack/predef/language/stdc.h>
+#include <msgpack/predef/language/stdcpp.h>
+#include <msgpack/predef/language/objc.h>
+
+#endif
diff --git a/include/msgpack/predef/language/objc.h b/include/msgpack/predef/language/objc.h
new file mode 100644
index 0000000..0b0cb41
--- /dev/null
+++ b/include/msgpack/predef/language/objc.h
@@ -0,0 +1,43 @@
+/*
+Copyright Rene Rivera 2011-2013
+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_LANGUAGE_OBJC_H
+#define MSGPACK_PREDEF_LANGUAGE_OBJC_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LANG_OBJC`]
+
+[@http://en.wikipedia.org/wiki/Objective-C Objective-C] language.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__OBJC__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_LANG_OBJC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__OBJC__)
+# undef MSGPACK_LANG_OBJC
+# define MSGPACK_LANG_OBJC MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_LANG_OBJC
+# define MSGPACK_LANG_OBJC_AVAILABLE
+#endif
+
+#define MSGPACK_LANG_OBJC_NAME "Objective-C"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_OBJC,MSGPACK_LANG_OBJC_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/language/stdc.h b/include/msgpack/predef/language/stdc.h
new file mode 100644
index 0000000..a913c32
--- /dev/null
+++ b/include/msgpack/predef/language/stdc.h
@@ -0,0 +1,54 @@
+/*
+Copyright Rene Rivera 2011-2012
+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_LANGUAGE_STDC_H
+#define MSGPACK_PREDEF_LANGUAGE_STDC_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LANG_STDC`]
+
+[@http://en.wikipedia.org/wiki/C_(programming_language) Standard C] language.
+If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__STDC__`] [__predef_detection__]]
+
+ [[`__STDC_VERSION__`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_LANG_STDC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__STDC__)
+# undef MSGPACK_LANG_STDC
+# if defined(__STDC_VERSION__)
+# if (__STDC_VERSION__ > 100)
+# define MSGPACK_LANG_STDC MSGPACK_PREDEF_MAKE_YYYYMM(__STDC_VERSION__)
+# else
+# define MSGPACK_LANG_STDC MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# else
+# define MSGPACK_LANG_STDC MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_LANG_STDC
+# define MSGPACK_LANG_STDC_AVAILABLE
+#endif
+
+#define MSGPACK_LANG_STDC_NAME "Standard C"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_STDC,MSGPACK_LANG_STDC_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/language/stdcpp.h b/include/msgpack/predef/language/stdcpp.h
new file mode 100644
index 0000000..5915489
--- /dev/null
+++ b/include/msgpack/predef/language/stdcpp.h
@@ -0,0 +1,124 @@
+/*
+Copyright Rene Rivera 2011-2013
+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_LANGUAGE_STDCPP_H
+#define MSGPACK_PREDEF_LANGUAGE_STDCPP_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LANG_STDCPP`]
+
+[@http://en.wikipedia.org/wiki/C%2B%2B Standard C++] language.
+If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date.
+Because of the way the C++ standardization process works the
+defined version year will not be the commonly known year of the standard.
+Specifically the defined versions are:
+
+[table Detected Version Number vs. C++ Standard Year
+ [[Detected Version Number] [Standard Year] [C++ Standard]]
+ [[27.11.1] [1998] [ISO/IEC 14882:1998]]
+ [[41.12.1] [2011] [ISO/IEC 14882:2011]]
+]
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__cplusplus`] [__predef_detection__]]
+
+ [[`__cplusplus`] [YYYY.MM.1]]
+ ]
+ */
+
+#define MSGPACK_LANG_STDCPP MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__cplusplus)
+# undef MSGPACK_LANG_STDCPP
+# if (__cplusplus > 100)
+# define MSGPACK_LANG_STDCPP MSGPACK_PREDEF_MAKE_YYYYMM(__cplusplus)
+# else
+# define MSGPACK_LANG_STDCPP MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_LANG_STDCPP
+# define MSGPACK_LANG_STDCPP_AVAILABLE
+#endif
+
+#define MSGPACK_LANG_STDCPP_NAME "Standard C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_STDCPP,MSGPACK_LANG_STDCPP_NAME)
+
+
+/*`
+[heading `MSGPACK_LANG_STDCPPCLI`]
+
+[@http://en.wikipedia.org/wiki/C%2B%2B/CLI Standard C++/CLI] language.
+If available, the year of the standard is detected as YYYY.MM.1 from the Epoc date.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__cplusplus_cli`] [__predef_detection__]]
+
+ [[`__cplusplus_cli`] [YYYY.MM.1]]
+ ]
+ */
+
+#define MSGPACK_LANG_STDCPPCLI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__cplusplus_cli)
+# undef MSGPACK_LANG_STDCPPCLI
+# if (__cplusplus_cli > 100)
+# define MSGPACK_LANG_STDCPPCLI MSGPACK_PREDEF_MAKE_YYYYMM(__cplusplus_cli)
+# else
+# define MSGPACK_LANG_STDCPPCLI MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_LANG_STDCPPCLI
+# define MSGPACK_LANG_STDCPPCLI_AVAILABLE
+#endif
+
+#define MSGPACK_LANG_STDCPPCLI_NAME "Standard C++/CLI"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_STDCPPCLI,MSGPACK_LANG_STDCPPCLI_NAME)
+
+
+/*`
+[heading `MSGPACK_LANG_STDECPP`]
+
+[@http://en.wikipedia.org/wiki/Embedded_C%2B%2B Standard Embedded C++] language.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__embedded_cplusplus`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_LANG_STDECPP MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__embedded_cplusplus)
+# undef MSGPACK_LANG_STDECPP
+# define MSGPACK_LANG_STDECPP MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_LANG_STDECPP
+# define MSGPACK_LANG_STDECPP_AVAILABLE
+#endif
+
+#define MSGPACK_LANG_STDECPP_NAME "Standard Embedded C++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LANG_STDECPP,MSGPACK_LANG_STDECPP_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library.h b/include/msgpack/predef/library.h
new file mode 100644
index 0000000..20ecc56
--- /dev/null
+++ b/include/msgpack/predef/library.h
@@ -0,0 +1,14 @@
+/*
+Copyright Rene Rivera 2008-2012
+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_LIBRARY_H
+#define MSGPACK_PREDEF_LIBRARY_H
+
+#include <msgpack/predef/library/c.h>
+#include <msgpack/predef/library/std.h>
+
+#endif
diff --git a/include/msgpack/predef/library/c.h b/include/msgpack/predef/library/c.h
new file mode 100644
index 0000000..4794a8d
--- /dev/null
+++ b/include/msgpack/predef/library/c.h
@@ -0,0 +1,18 @@
+/*
+Copyright Rene Rivera 2008-2012
+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_LIBRARY_C_H
+#define MSGPACK_PREDEF_LIBRARY_C_H
+
+#include <msgpack/predef/library/c/_prefix.h>
+
+#include <msgpack/predef/library/c/gnu.h>
+#include <msgpack/predef/library/c/uc.h>
+#include <msgpack/predef/library/c/vms.h>
+#include <msgpack/predef/library/c/zos.h>
+
+#endif
diff --git a/include/msgpack/predef/library/c/_prefix.h b/include/msgpack/predef/library/c/_prefix.h
new file mode 100644
index 0000000..d16c373
--- /dev/null
+++ b/include/msgpack/predef/library/c/_prefix.h
@@ -0,0 +1,13 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_C__PREFIX_H
+#define MSGPACK_PREDEF_LIBRARY_C__PREFIX_H
+
+#include <msgpack/predef/detail/_cassert.h>
+
+#endif
diff --git a/include/msgpack/predef/library/c/gnu.h b/include/msgpack/predef/library/c/gnu.h
new file mode 100644
index 0000000..9e8f5d6
--- /dev/null
+++ b/include/msgpack/predef/library/c/gnu.h
@@ -0,0 +1,62 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_C_GNU_H
+#define MSGPACK_PREDEF_LIBRARY_C_GNU_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+#include <msgpack/predef/library/c/_prefix.h>
+
+#if defined(__STDC__)
+#include <stddef.h>
+#elif defined(__cplusplus)
+#include <cstddef>
+#endif
+
+/*`
+[heading `MSGPACK_LIB_C_GNU`]
+
+[@http://en.wikipedia.org/wiki/Glibc GNU glibc] Standard C library.
+Version number available as major, and minor.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__GLIBC__`] [__predef_detection__]]
+ [[`__GNU_LIBRARY__`] [__predef_detection__]]
+
+ [[`__GLIBC__`, `__GLIBC_MINOR__`] [V.R.0]]
+ [[`__GNU_LIBRARY__`, `__GNU_LIBRARY_MINOR__`] [V.R.0]]
+ ]
+ */
+
+#define MSGPACK_LIB_C_GNU MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__GLIBC__) || defined(__GNU_LIBRARY__)
+# undef MSGPACK_LIB_C_GNU
+# if defined(__GLIBC__)
+# define MSGPACK_LIB_C_GNU \
+ MSGPACK_VERSION_NUMBER(__GLIBC__,__GLIBC_MINOR__,0)
+# else
+# define MSGPACK_LIB_C_GNU \
+ MSGPACK_VERSION_NUMBER(__GNU_LIBRARY__,__GNU_LIBRARY_MINOR__,0)
+# endif
+#endif
+
+#if MSGPACK_LIB_C_GNU
+# define MSGPACK_LIB_C_GNU_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_C_GNU_NAME "GNU"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_GNU,MSGPACK_LIB_C_GNU_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/c/uc.h b/include/msgpack/predef/library/c/uc.h
new file mode 100644
index 0000000..7dbd838
--- /dev/null
+++ b/include/msgpack/predef/library/c/uc.h
@@ -0,0 +1,48 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_C_UC_H
+#define MSGPACK_PREDEF_LIBRARY_C_UC_H
+
+#include <msgpack/predef/library/c/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_C_UC`]
+
+[@http://en.wikipedia.org/wiki/Uclibc uClibc] Standard C library.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__UCLIBC__`] [__predef_detection__]]
+
+ [[`__UCLIBC_MAJOR__`, `__UCLIBC_MINOR__`, `__UCLIBC_SUBLEVEL__`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_LIB_C_UC MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__UCLIBC__)
+# undef MSGPACK_LIB_C_UC
+# define MSGPACK_LIB_C_UC MSGPACK_VERSION_NUMBER(\
+ __UCLIBC_MAJOR__,__UCLIBC_MINOR__,__UCLIBC_SUBLEVEL__)
+#endif
+
+#if MSGPACK_LIB_C_UC
+# define MSGPACK_LIB_C_UC_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_C_UC_NAME "uClibc"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_UC,MSGPACK_LIB_C_UC_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/c/vms.h b/include/msgpack/predef/library/c/vms.h
new file mode 100644
index 0000000..c2ef4d3
--- /dev/null
+++ b/include/msgpack/predef/library/c/vms.h
@@ -0,0 +1,48 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_C_VMS_H
+#define MSGPACK_PREDEF_LIBRARY_C_VMS_H
+
+#include <msgpack/predef/library/c/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_C_VMS`]
+
+VMS libc Standard C library.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__CRTL_VER`] [__predef_detection__]]
+
+ [[`__CRTL_VER`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_LIB_C_VMS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__CRTL_VER)
+# undef MSGPACK_LIB_C_VMS
+# define MSGPACK_LIB_C_VMS MSGPACK_PREDEF_MAKE_10_VVRR0PP00(__CRTL_VER)
+#endif
+
+#if MSGPACK_LIB_C_VMS
+# define MSGPACK_LIB_C_VMS_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_C_VMS_NAME "VMS"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_VMS,MSGPACK_LIB_C_VMS_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/c/zos.h b/include/msgpack/predef/library/c/zos.h
new file mode 100644
index 0000000..67cb504
--- /dev/null
+++ b/include/msgpack/predef/library/c/zos.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_C_ZOS_H
+#define MSGPACK_PREDEF_LIBRARY_C_ZOS_H
+
+#include <msgpack/predef/library/c/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_C_ZOS`]
+
+z/OS libc Standard C library.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__LIBREL__`] [__predef_detection__]]
+
+ [[`__LIBREL__`] [V.R.P]]
+ [[`__TARGET_LIB__`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_LIB_C_ZOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__LIBREL__)
+# undef MSGPACK_LIB_C_ZOS
+# if !defined(MSGPACK_LIB_C_ZOS) && defined(__LIBREL__)
+# define MSGPACK_LIB_C_ZOS MSGPACK_PREDEF_MAKE_0X_VRRPPPP(__LIBREL__)
+# endif
+# if !defined(MSGPACK_LIB_C_ZOS) && defined(__TARGET_LIB__)
+# define MSGPACK_LIB_C_ZOS MSGPACK_PREDEF_MAKE_0X_VRRPPPP(__TARGET_LIB__)
+# endif
+# if !defined(MSGPACK_LIB_C_ZOS)
+# define MSGPACK_LIB_C_ZOS MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_LIB_C_ZOS
+# define MSGPACK_LIB_C_ZOS_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_C_ZOS_NAME "z/OS"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_C_ZOS,MSGPACK_LIB_C_ZOS_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std.h b/include/msgpack/predef/library/std.h
new file mode 100644
index 0000000..7e5b208
--- /dev/null
+++ b/include/msgpack/predef/library/std.h
@@ -0,0 +1,23 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_H
+#define MSGPACK_PREDEF_LIBRARY_STD_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/library/std/cxx.h>
+#include <msgpack/predef/library/std/dinkumware.h>
+#include <msgpack/predef/library/std/libcomo.h>
+#include <msgpack/predef/library/std/modena.h>
+#include <msgpack/predef/library/std/msl.h>
+#include <msgpack/predef/library/std/roguewave.h>
+#include <msgpack/predef/library/std/sgi.h>
+#include <msgpack/predef/library/std/stdcpp3.h>
+#include <msgpack/predef/library/std/stlport.h>
+#include <msgpack/predef/library/std/vacpp.h>
+
+#endif
diff --git a/include/msgpack/predef/library/std/_prefix.h b/include/msgpack/predef/library/std/_prefix.h
new file mode 100644
index 0000000..6f9f566
--- /dev/null
+++ b/include/msgpack/predef/library/std/_prefix.h
@@ -0,0 +1,23 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD__PREFIX_H
+#define MSGPACK_PREDEF_LIBRARY_STD__PREFIX_H
+
+/*
+We need to include an STD header to gives us the context
+of which library we are using. The "smallest" code-wise header
+seems to be <exception>. Boost uses <utility> but as far
+as I can tell (RR) it's not a stand-alone header in most
+implementations. Using <exception> also has the benefit of
+being available in EC++, so we get a chance to make this work
+for embedded users. And since it's not a header impacted by TR1
+there's no magic needed for inclusion in the face of the
+Boost.TR1 library.
+*/
+#include <msgpack/predef/detail/_exception.h>
+
+#endif
diff --git a/include/msgpack/predef/library/std/cxx.h b/include/msgpack/predef/library/std/cxx.h
new file mode 100644
index 0000000..16d2a70
--- /dev/null
+++ b/include/msgpack/predef/library/std/cxx.h
@@ -0,0 +1,47 @@
+/*
+Copyright Rene Rivera 2011-2013
+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_LIBRARY_STD_CXX_H
+#define MSGPACK_PREDEF_LIBRARY_STD_CXX_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_CXX`]
+
+[@http://libcxx.llvm.org/ libc++] C++ Standard Library.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`_LIBCPP_VERSION`] [__predef_detection__]]
+
+ [[`_LIBCPP_VERSION`] [V.0.P]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_CXX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(_LIBCPP_VERSION)
+# undef MSGPACK_LIB_STD_CXX
+# define MSGPACK_LIB_STD_CXX MSGPACK_PREDEF_MAKE_10_VPPP(_LIBCPP_VERSION)
+#endif
+
+#if MSGPACK_LIB_STD_CXX
+# define MSGPACK_LIB_STD_CXX_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_CXX_NAME "libc++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_CXX,MSGPACK_LIB_STD_CXX_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std/dinkumware.h b/include/msgpack/predef/library/std/dinkumware.h
new file mode 100644
index 0000000..2bda26f
--- /dev/null
+++ b/include/msgpack/predef/library/std/dinkumware.h
@@ -0,0 +1,53 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_DINKUMWARE_H
+#define MSGPACK_PREDEF_LIBRARY_STD_DINKUMWARE_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_DINKUMWARE`]
+
+[@http://en.wikipedia.org/wiki/Dinkumware Dinkumware] Standard C++ Library.
+If available version number as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`_YVALS`, `__IBMCPP__`] [__predef_detection__]]
+ [[`_CPPLIB_VER`] [__predef_detection__]]
+
+ [[`_CPPLIB_VER`] [V.R.0]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_DINKUMWARE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
+# undef MSGPACK_LIB_STD_DINKUMWARE
+# if defined(_CPPLIB_VER)
+# define MSGPACK_LIB_STD_DINKUMWARE MSGPACK_PREDEF_MAKE_10_VVRR(_CPPLIB_VER)
+# else
+# define MSGPACK_LIB_STD_DINKUMWARE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_LIB_STD_DINKUMWARE
+# define MSGPACK_LIB_STD_DINKUMWARE_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_DINKUMWARE_NAME "Dinkumware"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_DINKUMWARE,MSGPACK_LIB_STD_DINKUMWARE_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std/libcomo.h b/include/msgpack/predef/library/std/libcomo.h
new file mode 100644
index 0000000..590f865
--- /dev/null
+++ b/include/msgpack/predef/library/std/libcomo.h
@@ -0,0 +1,48 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_LIBCOMO_H
+#define MSGPACK_PREDEF_LIBRARY_STD_LIBCOMO_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_COMO`]
+
+[@http://www.comeaucomputing.com/libcomo/ Comeau Computing] Standard C++ Library.
+Version number available as major.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__LIBCOMO__`] [__predef_detection__]]
+
+ [[`__LIBCOMO_VERSION__`] [V.0.0]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_COMO MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__LIBCOMO__)
+# undef MSGPACK_LIB_STD_COMO
+# define MSGPACK_LIB_STD_COMO MSGPACK_VERSION_NUMBER(__LIBCOMO_VERSION__,0,0)
+#endif
+
+#if MSGPACK_LIB_STD_COMO
+# define MSGPACK_LIB_STD_COMO_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_COMO_NAME "Comeau Computing"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_COMO,MSGPACK_LIB_STD_COMO_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std/modena.h b/include/msgpack/predef/library/std/modena.h
new file mode 100644
index 0000000..ff0582a
--- /dev/null
+++ b/include/msgpack/predef/library/std/modena.h
@@ -0,0 +1,46 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_MODENA_H
+#define MSGPACK_PREDEF_LIBRARY_STD_MODENA_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_MSIPL`]
+
+[@http://modena.us/ Modena Software Lib++] Standard C++ Library.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`MSIPL_COMPILE_H`] [__predef_detection__]]
+ [[`__MSIPL_COMPILE_H`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_MSIPL MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(MSIPL_COMPILE_H) || defined(__MSIPL_COMPILE_H)
+# undef MSGPACK_LIB_STD_MSIPL
+# define MSGPACK_LIB_STD_MSIPL MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_LIB_STD_MSIPL
+# define MSGPACK_LIB_STD_MSIPL_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_MSIPL_NAME "Modena Software Lib++"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_MSIPL,MSGPACK_LIB_STD_MSIPL_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std/msl.h b/include/msgpack/predef/library/std/msl.h
new file mode 100644
index 0000000..aa4cc2a
--- /dev/null
+++ b/include/msgpack/predef/library/std/msl.h
@@ -0,0 +1,54 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_MSL_H
+#define MSGPACK_PREDEF_LIBRARY_STD_MSL_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_MSL`]
+
+[@http://www.freescale.com/ Metrowerks] Standard C++ Library.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__MSL_CPP__`] [__predef_detection__]]
+ [[`__MSL__`] [__predef_detection__]]
+
+ [[`__MSL_CPP__`] [V.R.P]]
+ [[`__MSL__`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_MSL MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__MSL_CPP__) || defined(__MSL__)
+# undef MSGPACK_LIB_STD_MSL
+# if defined(__MSL_CPP__)
+# define MSGPACK_LIB_STD_MSL MSGPACK_PREDEF_MAKE_0X_VRPP(__MSL_CPP__)
+# else
+# define MSGPACK_LIB_STD_MSL MSGPACK_PREDEF_MAKE_0X_VRPP(__MSL__)
+# endif
+#endif
+
+#if MSGPACK_LIB_STD_MSL
+# define MSGPACK_LIB_STD_MSL_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_MSL_NAME "Metrowerks"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_MSL,MSGPACK_LIB_STD_MSL_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std/roguewave.h b/include/msgpack/predef/library/std/roguewave.h
new file mode 100644
index 0000000..2990496
--- /dev/null
+++ b/include/msgpack/predef/library/std/roguewave.h
@@ -0,0 +1,57 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_ROGUEWAVE_H
+#define MSGPACK_PREDEF_LIBRARY_STD_ROGUEWAVE_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_RW`]
+
+[@http://stdcxx.apache.org/ Roguewave] Standard C++ library.
+If available version number as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__STD_RWCOMPILER_H__`] [__predef_detection__]]
+ [[`_RWSTD_VER`] [__predef_detection__]]
+
+ [[`_RWSTD_VER`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_RW MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
+# undef MSGPACK_LIB_STD_RW
+# if defined(_RWSTD_VER)
+# if _RWSTD_VER < 0x010000
+# define MSGPACK_LIB_STD_RW MSGPACK_PREDEF_MAKE_0X_VVRRP(_RWSTD_VER)
+# else
+# define MSGPACK_LIB_STD_RW MSGPACK_PREDEF_MAKE_0X_VVRRPP(_RWSTD_VER)
+# endif
+# else
+# define MSGPACK_LIB_STD_RW MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_LIB_STD_RW
+# define MSGPACK_LIB_STD_RW_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_RW_NAME "Roguewave"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_RW,MSGPACK_LIB_STD_RW_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std/sgi.h b/include/msgpack/predef/library/std/sgi.h
new file mode 100644
index 0000000..ea081bb
--- /dev/null
+++ b/include/msgpack/predef/library/std/sgi.h
@@ -0,0 +1,52 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_SGI_H
+#define MSGPACK_PREDEF_LIBRARY_STD_SGI_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_SGI`]
+
+[@http://www.sgi.com/tech/stl/ SGI] Standard C++ library.
+If available version number as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__STL_CONFIG_H`] [__predef_detection__]]
+
+ [[`__SGI_STL`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_SGI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__STL_CONFIG_H)
+# undef MSGPACK_LIB_STD_SGI
+# if defined(__SGI_STL)
+# define MSGPACK_LIB_STD_SGI MSGPACK_PREDEF_MAKE_0X_VRP(__SGI_STL)
+# else
+# define MSGPACK_LIB_STD_SGI MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_LIB_STD_SGI
+# define MSGPACK_LIB_STD_SGI_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_SGI_NAME "SGI"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_SGI,MSGPACK_LIB_STD_SGI_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std/stdcpp3.h b/include/msgpack/predef/library/std/stdcpp3.h
new file mode 100644
index 0000000..2758f70
--- /dev/null
+++ b/include/msgpack/predef/library/std/stdcpp3.h
@@ -0,0 +1,54 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_STDCPP3_H
+#define MSGPACK_PREDEF_LIBRARY_STD_STDCPP3_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_GNU`]
+
+[@http://gcc.gnu.org/libstdc++/ GNU libstdc++] Standard C++ library.
+Version number available as year (from 1970), month, and day.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__GLIBCXX__`] [__predef_detection__]]
+ [[`__GLIBCPP__`] [__predef_detection__]]
+
+ [[`__GLIBCXX__`] [V.R.P]]
+ [[`__GLIBCPP__`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_GNU MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__GLIBCPP__) || defined(__GLIBCXX__)
+# undef MSGPACK_LIB_STD_GNU
+# if defined(__GLIBCXX__)
+# define MSGPACK_LIB_STD_GNU MSGPACK_PREDEF_MAKE_YYYYMMDD(__GLIBCXX__)
+# else
+# define MSGPACK_LIB_STD_GNU MSGPACK_PREDEF_MAKE_YYYYMMDD(__GLIBCPP__)
+# endif
+#endif
+
+#if MSGPACK_LIB_STD_GNU
+# define MSGPACK_LIB_STD_GNU_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_GNU_NAME "GNU"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_GNU,MSGPACK_LIB_STD_GNU_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std/stlport.h b/include/msgpack/predef/library/std/stlport.h
new file mode 100644
index 0000000..5b9eccc
--- /dev/null
+++ b/include/msgpack/predef/library/std/stlport.h
@@ -0,0 +1,60 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_STLPORT_H
+#define MSGPACK_PREDEF_LIBRARY_STD_STLPORT_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_STLPORT`]
+
+[@http://sourceforge.net/projects/stlport/ STLport Standard C++] library.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__SGI_STL_PORT`] [__predef_detection__]]
+ [[`_STLPORT_VERSION`] [__predef_detection__]]
+
+ [[`_STLPORT_MAJOR`, `_STLPORT_MINOR`, `_STLPORT_PATCHLEVEL`] [V.R.P]]
+ [[`_STLPORT_VERSION`] [V.R.P]]
+ [[`__SGI_STL_PORT`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_STLPORT MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+# undef MSGPACK_LIB_STD_STLPORT
+# if !defined(MSGPACK_LIB_STD_STLPORT) && defined(_STLPORT_MAJOR)
+# define MSGPACK_LIB_STD_STLPORT \
+ MSGPACK_VERSION_NUMBER(_STLPORT_MAJOR,_STLPORT_MINOR,_STLPORT_PATCHLEVEL)
+# endif
+# if !defined(MSGPACK_LIB_STD_STLPORT) && defined(_STLPORT_VERSION)
+# define MSGPACK_LIB_STD_STLPORT MSGPACK_PREDEF_MAKE_0X_VRP(_STLPORT_VERSION)
+# endif
+# if !defined(MSGPACK_LIB_STD_STLPORT)
+# define MSGPACK_LIB_STD_STLPORT MSGPACK_PREDEF_MAKE_0X_VRP(__SGI_STL_PORT)
+# endif
+#endif
+
+#if MSGPACK_LIB_STD_STLPORT
+# define MSGPACK_LIB_STD_STLPORT_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_STLPORT_NAME "STLport"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_STLPORT,MSGPACK_LIB_STD_STLPORT_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/library/std/vacpp.h b/include/msgpack/predef/library/std/vacpp.h
new file mode 100644
index 0000000..488a186
--- /dev/null
+++ b/include/msgpack/predef/library/std/vacpp.h
@@ -0,0 +1,45 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_LIBRARY_STD_VACPP_H
+#define MSGPACK_PREDEF_LIBRARY_STD_VACPP_H
+
+#include <msgpack/predef/library/std/_prefix.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_LIB_STD_IBM`]
+
+[@http://www.ibm.com/software/awdtools/xlcpp/ IBM VACPP Standard C++] library.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__IBMCPP__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_LIB_STD_IBM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__IBMCPP__)
+# undef MSGPACK_LIB_STD_IBM
+# define MSGPACK_LIB_STD_IBM MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_LIB_STD_IBM
+# define MSGPACK_LIB_STD_IBM_AVAILABLE
+#endif
+
+#define MSGPACK_LIB_STD_IBM_NAME "IBM VACPP"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_LIB_STD_IBM,MSGPACK_LIB_STD_IBM_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/make.h b/include/msgpack/predef/make.h
new file mode 100644
index 0000000..6a572b5
--- /dev/null
+++ b/include/msgpack/predef/make.h
@@ -0,0 +1,89 @@
+/*
+Copyright Rene Rivera 2008-2013
+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/detail/test.h>
+
+#ifndef MSGPACK_PREDEF_MAKE_H
+#define MSGPACK_PREDEF_MAKE_H
+
+/*
+Shorthands for the common version number formats used by vendors...
+*/
+
+/*`
+[heading `MSGPACK_PREDEF_MAKE_..` macros]
+
+These set of macros decompose common vendor version number
+macros which are composed version, revision, and patch digits.
+The naming convention indicates:
+
+* The base of the specified version number. "`MSGPACK_PREDEF_MAKE_0X`" for
+ hexadecimal digits, and "`MSGPACK_PREDEF_MAKE_10`" for decimal digits.
+* The format of the vendor version number. Where "`V`" indicates the version digits,
+ "`R`" indicates the revision digits, "`P`" indicates the patch digits, and "`0`"
+ indicates an ignored digit.
+
+Macros are:
+*/
+/*` `MSGPACK_PREDEF_MAKE_0X_VRP(V)` */
+#define MSGPACK_PREDEF_MAKE_0X_VRP(V) MSGPACK_VERSION_NUMBER((V&0xF00)>>8,(V&0xF0)>>4,(V&0xF))
+/*` `MSGPACK_PREDEF_MAKE_0X_VVRP(V)` */
+#define MSGPACK_PREDEF_MAKE_0X_VVRP(V) MSGPACK_VERSION_NUMBER((V&0xFF00)>>8,(V&0xF0)>>4,(V&0xF))
+/*` `MSGPACK_PREDEF_MAKE_0X_VRPP(V)` */
+#define MSGPACK_PREDEF_MAKE_0X_VRPP(V) MSGPACK_VERSION_NUMBER((V&0xF000)>>12,(V&0xF00)>>8,(V&0xFF))
+/*` `MSGPACK_PREDEF_MAKE_0X_VVRR(V)` */
+#define MSGPACK_PREDEF_MAKE_0X_VVRR(V) MSGPACK_VERSION_NUMBER((V&0xFF00)>>8,(V&0xFF),0)
+/*` `MSGPACK_PREDEF_MAKE_0X_VRRPPPP(V)` */
+#define MSGPACK_PREDEF_MAKE_0X_VRRPPPP(V) MSGPACK_VERSION_NUMBER((V&0xF000000)>>24,(V&0xFF0000)>>16,(V&0xFFFF))
+/*` `MSGPACK_PREDEF_MAKE_0X_VVRRP(V)` */
+#define MSGPACK_PREDEF_MAKE_0X_VVRRP(V) MSGPACK_VERSION_NUMBER((V&0xFF000)>>12,(V&0xFF0)>>4,(V&0xF))
+/*` `MSGPACK_PREDEF_MAKE_0X_VRRPP000(V)` */
+#define MSGPACK_PREDEF_MAKE_0X_VRRPP000(V) MSGPACK_VERSION_NUMBER((V&0xF0000000)>>28,(V&0xFF00000)>>20,(V&0xFF000)>>12)
+/*` `MSGPACK_PREDEF_MAKE_0X_VVRRPP(V)` */
+#define MSGPACK_PREDEF_MAKE_0X_VVRRPP(V) MSGPACK_VERSION_NUMBER((V&0xFF0000)>>16,(V&0xFF00)>>8,(V&0xFF))
+/*` `MSGPACK_PREDEF_MAKE_10_VPPP(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VPPP(V) MSGPACK_VERSION_NUMBER(((V)/1000)%10,0,(V)%1000)
+/*` `MSGPACK_PREDEF_MAKE_10_VRP(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VRP(V) MSGPACK_VERSION_NUMBER(((V)/100)%10,((V)/10)%10,(V)%10)
+/*` `MSGPACK_PREDEF_MAKE_10_VRP000(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VRP000(V) MSGPACK_VERSION_NUMBER(((V)/100000)%10,((V)/10000)%10,((V)/1000)%10)
+/*` `MSGPACK_PREDEF_MAKE_10_VRPP(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VRPP(V) MSGPACK_VERSION_NUMBER(((V)/1000)%10,((V)/100)%10,(V)%100)
+/*` `MSGPACK_PREDEF_MAKE_10_VRR(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VRR(V) MSGPACK_VERSION_NUMBER(((V)/100)%10,(V)%100,0)
+/*` `MSGPACK_PREDEF_MAKE_10_VRRPP(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VRRPP(V) MSGPACK_VERSION_NUMBER(((V)/10000)%10,((V)/100)%100,(V)%100)
+/*` `MSGPACK_PREDEF_MAKE_10_VRR000(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VRR000(V) MSGPACK_VERSION_NUMBER(((V)/100000)%10,((V)/1000)%100,0)
+/*` `MSGPACK_PREDEF_MAKE_10_VV00(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VV00(V) MSGPACK_VERSION_NUMBER(((V)/100)%100,0,0)
+/*` `MSGPACK_PREDEF_MAKE_10_VVRR(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VVRR(V) MSGPACK_VERSION_NUMBER(((V)/100)%100,(V)%100,0)
+/*` `MSGPACK_PREDEF_MAKE_10_VVRRPP(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VVRRPP(V) MSGPACK_VERSION_NUMBER(((V)/10000)%100,((V)/100)%100,(V)%100)
+/*` `MSGPACK_PREDEF_MAKE_10_VVRR0PP00(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VVRR0PP00(V) MSGPACK_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,((V)/100)%100)
+/*` `MSGPACK_PREDEF_MAKE_10_VVRR0PPPP(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VVRR0PPPP(V) MSGPACK_VERSION_NUMBER(((V)/10000000)%100,((V)/100000)%100,(V)%10000)
+/*` `MSGPACK_PREDEF_MAKE_10_VVRR00PP00(V)` */
+#define MSGPACK_PREDEF_MAKE_10_VVRR00PP00(V) MSGPACK_VERSION_NUMBER(((V)/100000000)%100,((V)/1000000)%100,((V)/100)%100)
+/*`
+[heading `MSGPACK_PREDEF_MAKE_*..` date macros]
+
+Date decomposition macros return a date in the relative to the 1970
+Epoch date. If the month is not available, January 1st is used as the month and day.
+If the day is not available, but the month is, the 1st of the month is used as the day.
+*/
+/*` `MSGPACK_PREDEF_MAKE_DATE(Y,M,D)` */
+#define MSGPACK_PREDEF_MAKE_DATE(Y,M,D) MSGPACK_VERSION_NUMBER((Y)%10000-1970,(M)%100,(D)%100)
+/*` `MSGPACK_PREDEF_MAKE_YYYYMMDD(V)` */
+#define MSGPACK_PREDEF_MAKE_YYYYMMDD(V) MSGPACK_PREDEF_MAKE_DATE(((V)/10000)%10000,((V)/100)%100,(V)%100)
+/*` `MSGPACK_PREDEF_MAKE_YYYY(V)` */
+#define MSGPACK_PREDEF_MAKE_YYYY(V) MSGPACK_PREDEF_MAKE_DATE(V,1,1)
+/*` `MSGPACK_PREDEF_MAKE_YYYYMM(V)` */
+#define MSGPACK_PREDEF_MAKE_YYYYMM(V) MSGPACK_PREDEF_MAKE_DATE((V)/100,(V),1)
+
+#endif
diff --git a/include/msgpack/predef/os.h b/include/msgpack/predef/os.h
new file mode 100644
index 0000000..c8b3f40
--- /dev/null
+++ b/include/msgpack/predef/os.h
@@ -0,0 +1,31 @@
+/*
+Copyright Rene Rivera 2008-2012
+Copyright Franz Detro 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_OS_H
+#define MSGPACK_PREDEF_OS_H
+
+#include <msgpack/predef/os/aix.h>
+#include <msgpack/predef/os/amigaos.h>
+#include <msgpack/predef/os/android.h>
+#include <msgpack/predef/os/beos.h>
+#include <msgpack/predef/os/bsd.h>
+#include <msgpack/predef/os/cygwin.h>
+#include <msgpack/predef/os/haiku.h>
+#include <msgpack/predef/os/hpux.h>
+#include <msgpack/predef/os/irix.h>
+#include <msgpack/predef/os/ios.h>
+#include <msgpack/predef/os/linux.h>
+#include <msgpack/predef/os/macos.h>
+#include <msgpack/predef/os/os400.h>
+#include <msgpack/predef/os/qnxnto.h>
+#include <msgpack/predef/os/solaris.h>
+#include <msgpack/predef/os/unix.h>
+#include <msgpack/predef/os/vms.h>
+#include <msgpack/predef/os/windows.h>
+
+#endif
diff --git a/include/msgpack/predef/os/aix.h b/include/msgpack/predef/os/aix.h
new file mode 100644
index 0000000..c7afc6e
--- /dev/null
+++ b/include/msgpack/predef/os/aix.h
@@ -0,0 +1,67 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_AIX_H
+#define MSGPACK_PREDEF_OS_AIX_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_AIX`]
+
+[@http://en.wikipedia.org/wiki/AIX_operating_system IBM AIX] operating system.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`_AIX`] [__predef_detection__]]
+ [[`__TOS_AIX__`] [__predef_detection__]]
+
+ [[`_AIX43`] [4.3.0]]
+ [[`_AIX41`] [4.1.0]]
+ [[`_AIX32`] [3.2.0]]
+ [[`_AIX3`] [3.0.0]]
+ ]
+ */
+
+#define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(_AIX) || defined(__TOS_AIX__) \
+ )
+# undef MSGPACK_OS_AIX
+# if !defined(MSGPACK_OS_AIX) && defined(_AIX43)
+# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER(4,3,0)
+# endif
+# if !defined(MSGPACK_OS_AIX) && defined(_AIX41)
+# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER(4,1,0)
+# endif
+# if !defined(MSGPACK_OS_AIX) && defined(_AIX32)
+# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER(3,2,0)
+# endif
+# if !defined(MSGPACK_OS_AIX) && defined(_AIX3)
+# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER(3,0,0)
+# endif
+# if !defined(MSGPACK_OS_AIX)
+# define MSGPACK_OS_AIX MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_OS_AIX
+# define MSGPACK_OS_AIX_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_AIX_NAME "IBM AIX"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_AIX,MSGPACK_OS_AIX_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/amigaos.h b/include/msgpack/predef/os/amigaos.h
new file mode 100644
index 0000000..9afcd4d
--- /dev/null
+++ b/include/msgpack/predef/os/amigaos.h
@@ -0,0 +1,47 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_AMIGAOS_H
+#define MSGPACK_PREDEF_OS_AMIGAOS_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_AMIGAOS`]
+
+[@http://en.wikipedia.org/wiki/AmigaOS AmigaOS] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`AMIGA`] [__predef_detection__]]
+ [[`__amigaos__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_AMIGAOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(AMIGA) || defined(__amigaos__) \
+ )
+# undef MSGPACK_OS_AMIGAOS
+# define MSGPACK_OS_AMIGAOS MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_AMIGAOS
+# define MSGPACK_OS_AMIGAOS_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_AMIGAOS_NAME "AmigaOS"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_AMIGAOS,MSGPACK_OS_AMIGAOS_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/android.h b/include/msgpack/predef/os/android.h
new file mode 100644
index 0000000..d0ba537
--- /dev/null
+++ b/include/msgpack/predef/os/android.h
@@ -0,0 +1,46 @@
+/*
+Copyright Rene Rivera 2013
+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_OS_ADROID_H
+#define MSGPACK_PREDEF_OS_ADROID_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_ANDROID`]
+
+[@http://en.wikipedia.org/wiki/Android_%28operating_system%29 Android] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__ANDROID__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_ANDROID MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__ANDROID__) \
+ )
+# undef MSGPACK_OS_ANDROID
+# define MSGPACK_OS_ANDROID MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_ANDROID
+# define MSGPACK_OS_ANDROID_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_ANDROID_NAME "Android"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_ANDROID,MSGPACK_OS_ANDROID_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/beos.h b/include/msgpack/predef/os/beos.h
new file mode 100644
index 0000000..7817f59
--- /dev/null
+++ b/include/msgpack/predef/os/beos.h
@@ -0,0 +1,46 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_BEOS_H
+#define MSGPACK_PREDEF_OS_BEOS_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_BEOS`]
+
+[@http://en.wikipedia.org/wiki/BeOS BeOS] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__BEOS__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_BEOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__BEOS__) \
+ )
+# undef MSGPACK_OS_BEOS
+# define MSGPACK_OS_BEOS MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_BEOS
+# define MSGPACK_OS_BEOS_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_BEOS_NAME "BeOS"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BEOS,MSGPACK_OS_BEOS_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/bsd.h b/include/msgpack/predef/os/bsd.h
new file mode 100644
index 0000000..6a4b63f
--- /dev/null
+++ b/include/msgpack/predef/os/bsd.h
@@ -0,0 +1,95 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_BSD_H
+#define MSGPACK_PREDEF_OS_BSD_H
+
+/* Special case: OSX will define BSD predefs if the sys/param.h
+ * header is included. We can guard against that, but only if we
+ * detect OSX first. Hence we will force include OSX detection
+ * before doing any BSD detection.
+ */
+#include <msgpack/predef/os/macos.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_BSD`]
+
+[@http://en.wikipedia.org/wiki/Berkeley_Software_Distribution BSD] operating system.
+
+BSD has various branch operating systems possible and each detected
+individually. This detects the following variations and sets a specific
+version number macro to match:
+
+* `MSGPACK_OS_BSD_DRAGONFLY` [@http://en.wikipedia.org/wiki/DragonFly_BSD DragonFly BSD]
+* `MSGPACK_OS_BSD_FREE` [@http://en.wikipedia.org/wiki/Freebsd FreeBSD]
+* `MSGPACK_OS_BSD_BSDI` [@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS]
+* `MSGPACK_OS_BSD_NET` [@http://en.wikipedia.org/wiki/Netbsd NetBSD]
+* `MSGPACK_OS_BSD_OPEN` [@http://en.wikipedia.org/wiki/Openbsd OpenBSD]
+
+[note The general `MSGPACK_OS_BSD` is set in all cases to indicate some form
+of BSD. If the above variants is detected the corresponding macro is also set.]
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`BSD`] [__predef_detection__]]
+ [[`_SYSTYPE_BSD`] [__predef_detection__]]
+
+ [[`BSD4_2`] [4.2.0]]
+ [[`BSD4_3`] [4.3.0]]
+ [[`BSD4_4`] [4.4.0]]
+ [[`BSD`] [V.R.0]]
+ ]
+ */
+
+#include <msgpack/predef/os/bsd/bsdi.h>
+#include <msgpack/predef/os/bsd/dragonfly.h>
+#include <msgpack/predef/os/bsd/free.h>
+#include <msgpack/predef/os/bsd/open.h>
+#include <msgpack/predef/os/bsd/net.h>
+
+#ifndef MSGPACK_OS_BSD
+#define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+#endif
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(BSD) || \
+ defined(_SYSTYPE_BSD) \
+ )
+# undef MSGPACK_OS_BSD
+# include <sys/param.h>
+# if !defined(MSGPACK_OS_BSD) && defined(BSD4_4)
+# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER(4,4,0)
+# endif
+# if !defined(MSGPACK_OS_BSD) && defined(BSD4_3)
+# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER(4,3,0)
+# endif
+# if !defined(MSGPACK_OS_BSD) && defined(BSD4_2)
+# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER(4,2,0)
+# endif
+# if !defined(MSGPACK_OS_BSD) && defined(BSD)
+# define MSGPACK_OS_BSD MSGPACK_PREDEF_MAKE_10_VVRR(BSD)
+# endif
+# if !defined(MSGPACK_OS_BSD)
+# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_OS_BSD
+# define MSGPACK_OS_BSD_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_BSD_NAME "BSD"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD,MSGPACK_OS_BSD_NAME)
+
+#endif
diff --git a/include/msgpack/predef/os/bsd/bsdi.h b/include/msgpack/predef/os/bsd/bsdi.h
new file mode 100644
index 0000000..9061066
--- /dev/null
+++ b/include/msgpack/predef/os/bsd/bsdi.h
@@ -0,0 +1,48 @@
+/*
+Copyright Rene Rivera 2012-2013
+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_OS_BSD_BSDI_H
+#define MSGPACK_PREDEF_OS_BSD_BSDI_H
+
+#include <msgpack/predef/os/bsd.h>
+
+/*`
+[heading `MSGPACK_OS_BSD_BSDI`]
+
+[@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__bsdi__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_BSD_BSDI MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__bsdi__) \
+ )
+# ifndef MSGPACK_OS_BSD_AVAILABLE
+# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE
+# define MSGPACK_OS_BSD_AVAILABLE
+# endif
+# undef MSGPACK_OS_BSD_BSDI
+# define MSGPACK_OS_BSD_BSDI MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_BSD_BSDI
+# define MSGPACK_OS_BSD_BSDI_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_BSD_BSDI_NAME "BSDi BSD/OS"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_BSDI,MSGPACK_OS_BSD_BSDI_NAME)
+
+#endif
diff --git a/include/msgpack/predef/os/bsd/dragonfly.h b/include/msgpack/predef/os/bsd/dragonfly.h
new file mode 100644
index 0000000..bdf3e99
--- /dev/null
+++ b/include/msgpack/predef/os/bsd/dragonfly.h
@@ -0,0 +1,50 @@
+/*
+Copyright Rene Rivera 2012-2013
+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_OS_BSD_DRAGONFLY_H
+#define MSGPACK_PREDEF_OS_BSD_DRAGONFLY_H
+
+#include <msgpack/predef/os/bsd.h>
+
+/*`
+[heading `MSGPACK_OS_BSD_DRAGONFLY`]
+
+[@http://en.wikipedia.org/wiki/DragonFly_BSD DragonFly BSD] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__DragonFly__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_BSD_DRAGONFLY MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__DragonFly__) \
+ )
+# ifndef MSGPACK_OS_BSD_AVAILABLE
+# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE
+# define MSGPACK_OS_BSD_AVAILABLE
+# endif
+# undef MSGPACK_OS_BSD_DRAGONFLY
+# if defined(__DragonFly__)
+# define MSGPACK_OS_DRAGONFLY_BSD MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_OS_BSD_DRAGONFLY
+# define MSGPACK_OS_BSD_DRAGONFLY_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_BSD_DRAGONFLY_NAME "DragonFly BSD"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_DRAGONFLY,MSGPACK_OS_BSD_DRAGONFLY_NAME)
+
+#endif
diff --git a/include/msgpack/predef/os/bsd/free.h b/include/msgpack/predef/os/bsd/free.h
new file mode 100644
index 0000000..33d2494
--- /dev/null
+++ b/include/msgpack/predef/os/bsd/free.h
@@ -0,0 +1,60 @@
+/*
+Copyright Rene Rivera 2012-2013
+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_OS_BSD_FREE_H
+#define MSGPACK_PREDEF_OS_BSD_FREE_H
+
+#include <msgpack/predef/os/bsd.h>
+
+/*`
+[heading `MSGPACK_OS_BSD_FREE`]
+
+[@http://en.wikipedia.org/wiki/Freebsd FreeBSD] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__FreeBSD__`] [__predef_detection__]]
+
+ [[`__FreeBSD_version`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_OS_BSD_FREE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__FreeBSD__) \
+ )
+# ifndef MSGPACK_OS_BSD_AVAILABLE
+# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE
+# define MSGPACK_OS_BSD_AVAILABLE
+# endif
+# undef MSGPACK_OS_BSD_FREE
+# if defined(__FreeBSD_version)
+# if __FreeBSD_version < 500000
+# define MSGPACK_OS_BSD_FREE \
+ MSGPACK_PREDEF_MAKE_10_VRP000(__FreeBSD_version)
+# else
+# define MSGPACK_OS_BSD_FREE \
+ MSGPACK_PREDEF_MAKE_10_VRR000(__FreeBSD_version)
+# endif
+# else
+# define MSGPACK_OS_BSD_FREE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_OS_BSD_FREE
+# define MSGPACK_OS_BSD_FREE_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_BSD_FREE_NAME "Free BSD"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_FREE,MSGPACK_OS_BSD_FREE_NAME)
+
+#endif
diff --git a/include/msgpack/predef/os/bsd/net.h b/include/msgpack/predef/os/bsd/net.h
new file mode 100644
index 0000000..8953e07
--- /dev/null
+++ b/include/msgpack/predef/os/bsd/net.h
@@ -0,0 +1,84 @@
+/*
+Copyright Rene Rivera 2012-2013
+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_OS_BSD_NET_H
+#define MSGPACK_PREDEF_OS_BSD_NET_H
+
+#include <msgpack/predef/os/bsd.h>
+
+/*`
+[heading `MSGPACK_OS_BSD_NET`]
+
+[@http://en.wikipedia.org/wiki/Netbsd NetBSD] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__NETBSD__`] [__predef_detection__]]
+ [[`__NetBSD__`] [__predef_detection__]]
+
+ [[`__NETBSD_version`] [V.R.P]]
+ [[`NetBSD0_8`] [0.8.0]]
+ [[`NetBSD0_9`] [0.9.0]]
+ [[`NetBSD1_0`] [1.0.0]]
+ [[`__NetBSD_Version`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__NETBSD__) || defined(__NetBSD__) \
+ )
+# ifndef MSGPACK_OS_BSD_AVAILABLE
+# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE
+# define MSGPACK_OS_BSD_AVAILABLE
+# endif
+# undef MSGPACK_OS_BSD_NET
+# if defined(__NETBSD__)
+# if defined(__NETBSD_version)
+# if __NETBSD_version < 500000
+# define MSGPACK_OS_BSD_NET \
+ MSGPACK_PREDEF_MAKE_10_VRP000(__NETBSD_version)
+# else
+# define MSGPACK_OS_BSD_NET \
+ MSGPACK_PREDEF_MAKE_10_VRR000(__NETBSD_version)
+# endif
+# else
+# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# elif defined(__NetBSD__)
+# if !defined(MSGPACK_OS_BSD_NET) && defined(NetBSD0_8)
+# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER(0,8,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_NET) && defined(NetBSD0_9)
+# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER(0,9,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_NET) && defined(NetBSD1_0)
+# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER(1,0,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_NET) && defined(__NetBSD_Version)
+# define MSGPACK_OS_BSD_NET \
+ MSGPACK_PREDEF_MAKE_10_VVRR00PP00(__NetBSD_Version)
+# endif
+# if !defined(MSGPACK_OS_BSD_NET)
+# define MSGPACK_OS_BSD_NET MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
+#endif
+
+#if MSGPACK_OS_BSD_NET
+# define MSGPACK_OS_BSD_NET_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_BSD_NET_NAME "DragonFly BSD"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_NET,MSGPACK_OS_BSD_NET_NAME)
+
+#endif
diff --git a/include/msgpack/predef/os/bsd/open.h b/include/msgpack/predef/os/bsd/open.h
new file mode 100644
index 0000000..9b83d86
--- /dev/null
+++ b/include/msgpack/predef/os/bsd/open.h
@@ -0,0 +1,171 @@
+/*
+Copyright Rene Rivera 2012-2013
+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_OS_BSD_OPEN_H
+#define MSGPACK_PREDEF_OS_BSD_OPEN_H
+
+#include <msgpack/predef/os/bsd.h>
+
+/*`
+[heading `MSGPACK_OS_BSD_OPEN`]
+
+[@http://en.wikipedia.org/wiki/Openbsd OpenBSD] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__OpenBSD__`] [__predef_detection__]]
+
+ [[`OpenBSD2_0`] [2.0.0]]
+ [[`OpenBSD2_1`] [2.1.0]]
+ [[`OpenBSD2_2`] [2.2.0]]
+ [[`OpenBSD2_3`] [2.3.0]]
+ [[`OpenBSD2_4`] [2.4.0]]
+ [[`OpenBSD2_5`] [2.5.0]]
+ [[`OpenBSD2_6`] [2.6.0]]
+ [[`OpenBSD2_7`] [2.7.0]]
+ [[`OpenBSD2_8`] [2.8.0]]
+ [[`OpenBSD2_9`] [2.9.0]]
+ [[`OpenBSD3_0`] [3.0.0]]
+ [[`OpenBSD3_1`] [3.1.0]]
+ [[`OpenBSD3_2`] [3.2.0]]
+ [[`OpenBSD3_3`] [3.3.0]]
+ [[`OpenBSD3_4`] [3.4.0]]
+ [[`OpenBSD3_5`] [3.5.0]]
+ [[`OpenBSD3_6`] [3.6.0]]
+ [[`OpenBSD3_7`] [3.7.0]]
+ [[`OpenBSD3_8`] [3.8.0]]
+ [[`OpenBSD3_9`] [3.9.0]]
+ [[`OpenBSD4_0`] [4.0.0]]
+ [[`OpenBSD4_1`] [4.1.0]]
+ [[`OpenBSD4_2`] [4.2.0]]
+ [[`OpenBSD4_3`] [4.3.0]]
+ [[`OpenBSD4_4`] [4.4.0]]
+ [[`OpenBSD4_5`] [4.5.0]]
+ [[`OpenBSD4_6`] [4.6.0]]
+ [[`OpenBSD4_7`] [4.7.0]]
+ [[`OpenBSD4_8`] [4.8.0]]
+ [[`OpenBSD4_9`] [4.9.0]]
+ ]
+ */
+
+#define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__OpenBSD__) \
+ )
+# ifndef MSGPACK_OS_BSD_AVAILABLE
+# define MSGPACK_OS_BSD MSGPACK_VERSION_NUMBER_AVAILABLE
+# define MSGPACK_OS_BSD_AVAILABLE
+# endif
+# undef MSGPACK_OS_BSD_OPEN
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_0)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,0,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_1)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,1,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_2)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,2,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_3)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,3,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_4)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,4,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_5)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,5,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_6)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,6,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_7)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,7,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_8)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,8,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD2_9)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(2,9,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_0)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,0,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_1)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,1,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_2)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,2,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_3)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,3,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_4)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,4,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_5)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,5,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_6)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,6,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_7)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,7,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_8)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,8,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD3_9)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(3,9,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_0)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,0,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_1)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,1,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_2)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,2,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_3)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,3,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_4)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,4,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_5)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,5,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_6)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,6,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_7)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,7,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_8)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,8,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN) && defined(OpenBSD4_9)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER(4,9,0)
+# endif
+# if !defined(MSGPACK_OS_BSD_OPEN)
+# define MSGPACK_OS_BSD_OPEN MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_OS_BSD_OPEN
+# define MSGPACK_OS_BSD_OPEN_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_BSD_OPEN_NAME "OpenBSD"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_BSD_OPEN,MSGPACK_OS_BSD_OPEN_NAME)
+
+#endif
diff --git a/include/msgpack/predef/os/cygwin.h b/include/msgpack/predef/os/cygwin.h
new file mode 100644
index 0000000..dc595a4
--- /dev/null
+++ b/include/msgpack/predef/os/cygwin.h
@@ -0,0 +1,46 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_CYGWIN_H
+#define MSGPACK_PREDEF_OS_CYGWIN_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_CYGWIN`]
+
+[@http://en.wikipedia.org/wiki/Cygwin Cygwin] evironment.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__CYGWIN__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_CYGWIN MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__CYGWIN__) \
+ )
+# undef MSGPACK_OS_CYGWIN
+# define MSGPACK_OS_CGYWIN MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_CYGWIN
+# define MSGPACK_OS_CYGWIN_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_CYGWIN_NAME "Cygwin"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_CYGWIN,MSGPACK_OS_CYGWIN_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/haiku.h b/include/msgpack/predef/os/haiku.h
new file mode 100644
index 0000000..8d18d3c
--- /dev/null
+++ b/include/msgpack/predef/os/haiku.h
@@ -0,0 +1,47 @@
+/*
+Copyright Jessica Hamilton 2014
+Copyright Rene Rivera 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_OS_HAIKU_H
+#define MSGPACK_PREDEF_OS_HAIKU_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_HAIKU`]
+
+[@http://en.wikipedia.org/wiki/Haiku_(operating_system) Haiku] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__HAIKU__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_HAIKU MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__HAIKU__) \
+ )
+# undef MSGPACK_OS_HAIKU
+# define MSGPACK_OS_HAIKU MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_HAIKU
+# define MSGPACK_OS_HAIKU_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_HAIKU_NAME "Haiku"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_HAIKU,MSGPACK_OS_HAIKU_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/hpux.h b/include/msgpack/predef/os/hpux.h
new file mode 100644
index 0000000..7aa0fca
--- /dev/null
+++ b/include/msgpack/predef/os/hpux.h
@@ -0,0 +1,48 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_HPUX_H
+#define MSGPACK_PREDEF_OS_HPUX_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_HPUX`]
+
+[@http://en.wikipedia.org/wiki/HP-UX HP-UX] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`hpux`] [__predef_detection__]]
+ [[`_hpux`] [__predef_detection__]]
+ [[`__hpux`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_HPUX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(hpux) || defined(_hpux) || defined(__hpux) \
+ )
+# undef MSGPACK_OS_HPUX
+# define MSGPACK_OS_HPUX MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_HPUX
+# define MSGPACK_OS_HPUX_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_HPUX_NAME "HP-UX"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_HPUX,MSGPACK_OS_HPUX_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/ios.h b/include/msgpack/predef/os/ios.h
new file mode 100644
index 0000000..99ca70b
--- /dev/null
+++ b/include/msgpack/predef/os/ios.h
@@ -0,0 +1,51 @@
+/*
+Copyright Franz Detro 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_OS_IOS_H
+#define MSGPACK_PREDEF_OS_IOS_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_IOS`]
+
+[@http://en.wikipedia.org/wiki/iOS iOS] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__APPLE__`] [__predef_detection__]]
+ [[`__MACH__`] [__predef_detection__]]
+ [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__predef_detection__]]
+
+ [[`__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__`] [__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000]]
+ ]
+ */
+
+#define MSGPACK_OS_IOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__APPLE__) && defined(__MACH__) && \
+ defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) \
+ )
+# undef MSGPACK_OS_IOS
+# define MSGPACK_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000)
+#endif
+
+#if MSGPACK_OS_IOS
+# define MSGPACK_OS_IOS_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_IOS_NAME "iOS"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_IOS,MSGPACK_OS_IOS_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/irix.h b/include/msgpack/predef/os/irix.h
new file mode 100644
index 0000000..e34f589
--- /dev/null
+++ b/include/msgpack/predef/os/irix.h
@@ -0,0 +1,47 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_IRIX_H
+#define MSGPACK_PREDEF_OS_IRIX_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_IRIX`]
+
+[@http://en.wikipedia.org/wiki/Irix IRIX] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`sgi`] [__predef_detection__]]
+ [[`__sgi`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_IRIX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(sgi) || defined(__sgi) \
+ )
+# undef MSGPACK_OS_IRIX
+# define MSGPACK_OS_IRIX MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_IRIX
+# define MSGPACK_OS_IRIX_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_IRIX_NAME "IRIX"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_IRIX,MSGPACK_OS_IRIX_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/linux.h b/include/msgpack/predef/os/linux.h
new file mode 100644
index 0000000..0b5103c
--- /dev/null
+++ b/include/msgpack/predef/os/linux.h
@@ -0,0 +1,47 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_LINUX_H
+#define MSGPACK_PREDEF_OS_LINUX_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_LINUX`]
+
+[@http://en.wikipedia.org/wiki/Linux Linux] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`linux`] [__predef_detection__]]
+ [[`__linux`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(linux) || defined(__linux) \
+ )
+# undef MSGPACK_OS_LINUX
+# define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_LINUX
+# define MSGPACK_OS_LINUX_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_LINUX_NAME "Linux"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_LINUX,MSGPACK_OS_LINUX_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/macos.h b/include/msgpack/predef/os/macos.h
new file mode 100644
index 0000000..7c8113c
--- /dev/null
+++ b/include/msgpack/predef/os/macos.h
@@ -0,0 +1,66 @@
+/*
+Copyright Rene Rivera 2008-2013
+Copyright Franz Detro 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_OS_MACOS_H
+#define MSGPACK_PREDEF_OS_MACOS_H
+
+/* Special case: iOS will define the same predefs as MacOS, and additionally
+ '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__'. We can guard against that,
+ but only if we detect iOS first. Hence we will force include iOS detection
+ * before doing any MacOS detection.
+ */
+#include <msgpack/predef/os/ios.h>
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_MACOS`]
+
+[@http://en.wikipedia.org/wiki/Mac_OS Mac OS] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`macintosh`] [__predef_detection__]]
+ [[`Macintosh`] [__predef_detection__]]
+ [[`__APPLE__`] [__predef_detection__]]
+ [[`__MACH__`] [__predef_detection__]]
+
+ [[`__APPLE__`, `__MACH__`] [10.0.0]]
+ [[ /otherwise/ ] [9.0.0]]
+ ]
+ */
+
+#define MSGPACK_OS_MACOS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(macintosh) || defined(Macintosh) || \
+ (defined(__APPLE__) && defined(__MACH__)) \
+ )
+# undef MSGPACK_OS_MACOS
+# if !defined(MSGPACK_OS_MACOS) && defined(__APPLE__) && defined(__MACH__)
+# define MSGPACK_OS_MACOS MSGPACK_VERSION_NUMBER(10,0,0)
+# endif
+# if !defined(MSGPACK_OS_MACOS)
+# define MSGPACK_OS_MACOS MSGPACK_VERSION_NUMBER(9,0,0)
+# endif
+#endif
+
+#if MSGPACK_OS_MACOS
+# define MSGPACK_OS_MACOS_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_MACOS_NAME "Mac OS"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_MACOS,MSGPACK_OS_MACOS_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/os400.h b/include/msgpack/predef/os/os400.h
new file mode 100644
index 0000000..18d4677
--- /dev/null
+++ b/include/msgpack/predef/os/os400.h
@@ -0,0 +1,46 @@
+/*
+Copyright Rene Rivera 2011-2013
+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_OS_OS400_H
+#define MSGPACK_PREDEF_OS_OS400_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_OS400`]
+
+[@http://en.wikipedia.org/wiki/IBM_i IBM OS/400] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__OS400__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_OS400 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__OS400__) \
+ )
+# undef MSGPACK_OS_OS400
+# define MSGPACK_OS_OS400 MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_OS400
+# define MSGPACK_OS_OS400_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_OS400_NAME "IBM OS/400"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_OS400,MSGPACK_OS_OS400_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/qnxnto.h b/include/msgpack/predef/os/qnxnto.h
new file mode 100644
index 0000000..6d16fe5
--- /dev/null
+++ b/include/msgpack/predef/os/qnxnto.h
@@ -0,0 +1,60 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_QNXNTO_H
+#define MSGPACK_PREDEF_OS_QNXNTO_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_QNX`]
+
+[@http://en.wikipedia.org/wiki/QNX QNX] operating system.
+Version number available as major, and minor if possible. And
+version 4 is specifically detected.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__QNX__`] [__predef_detection__]]
+ [[`__QNXNTO__`] [__predef_detection__]]
+
+ [[`_NTO_VERSION`] [V.R.0]]
+ [[`__QNX__`] [4.0.0]]
+ ]
+ */
+
+#define MSGPACK_OS_QNX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(__QNX__) || defined(__QNXNTO__) \
+ )
+# undef MSGPACK_OS_QNX
+# if !defined(MSGPACK_OS_QNX) && defined(_NTO_VERSION)
+# define MSGPACK_OS_QNX MSGPACK_PREDEF_MAKE_10_VVRR(_NTO_VERSION)
+# endif
+# if !defined(MSGPACK_OS_QNX) && defined(__QNX__)
+# define MSGPACK_OS_QNX MSGPACK_VERSION_NUMBER(4,0,0)
+# endif
+# if !defined(MSGPACK_OS_QNX)
+# define MSGPACK_OS_QNX MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_OS_QNX
+# define MSGPACK_OS_QNX_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_QNX_NAME "QNX"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_QNX,MSGPACK_OS_QNX_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/solaris.h b/include/msgpack/predef/os/solaris.h
new file mode 100644
index 0000000..83ac9e7
--- /dev/null
+++ b/include/msgpack/predef/os/solaris.h
@@ -0,0 +1,47 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_SOLARIS_H
+#define MSGPACK_PREDEF_OS_SOLARIS_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_SOLARIS`]
+
+[@http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`sun`] [__predef_detection__]]
+ [[`__sun`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_SOLARIS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(sun) || defined(__sun) \
+ )
+# undef MSGPACK_OS_SOLARIS
+# define MSGPACK_OS_SOLARIS MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_SOLARIS
+# define MSGPACK_OS_SOLARIS_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_SOLARIS_NAME "Solaris"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_SOLARIS,MSGPACK_OS_SOLARIS_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/unix.h b/include/msgpack/predef/os/unix.h
new file mode 100644
index 0000000..4d61fc0
--- /dev/null
+++ b/include/msgpack/predef/os/unix.h
@@ -0,0 +1,76 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_UNIX_H
+#define MSGPACK_PREDEF_OS_UNIX_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_UNIX`]
+
+[@http://en.wikipedia.org/wiki/Unix Unix Environment] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`unix`] [__predef_detection__]]
+ [[`__unix`] [__predef_detection__]]
+ [[`_XOPEN_SOURCE`] [__predef_detection__]]
+ [[`_POSIX_SOURCE`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_UNIX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(unix) || defined(__unix) || \
+ defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
+# undef MSGPACK_OS_UNIX
+# define MSGPACK_OS_UNIX MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_UNIX
+# define MSGPACK_OS_UNIX_AVAILABLE
+#endif
+
+#define MSGPACK_OS_UNIX_NAME "Unix Environment"
+
+/*`
+[heading `MSGPACK_OS_SVR4`]
+
+[@http://en.wikipedia.org/wiki/UNIX_System_V SVR4 Environment] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__sysv__`] [__predef_detection__]]
+ [[`__SVR4`] [__predef_detection__]]
+ [[`__svr4__`] [__predef_detection__]]
+ [[`_SYSTYPE_SVR4`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_SVR4 MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__sysv__) || defined(__SVR4) || \
+ defined(__svr4__) || defined(_SYSTYPE_SVR4)
+# undef MSGPACK_OS_SVR4
+# define MSGPACK_OS_SVR4 MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_SVR4
+# define MSGPACK_OS_SVR4_AVAILABLE
+#endif
+
+#define MSGPACK_OS_SVR4_NAME "SVR4 Environment"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_UNIX,MSGPACK_OS_UNIX_NAME)
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_SVR4,MSGPACK_OS_SVR4_NAME)
+
+#endif
diff --git a/include/msgpack/predef/os/vms.h b/include/msgpack/predef/os/vms.h
new file mode 100644
index 0000000..8607481
--- /dev/null
+++ b/include/msgpack/predef/os/vms.h
@@ -0,0 +1,53 @@
+/*
+Copyright Rene Rivera 2011-2013
+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_OS_VMS_H
+#define MSGPACK_PREDEF_OS_VMS_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_VMS`]
+
+[@http://en.wikipedia.org/wiki/Vms VMS] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`VMS`] [__predef_detection__]]
+ [[`__VMS`] [__predef_detection__]]
+
+ [[`__VMS_VER`] [V.R.P]]
+ ]
+ */
+
+#define MSGPACK_OS_VMS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(VMS) || defined(__VMS) \
+ )
+# undef MSGPACK_OS_VMS
+# if defined(__VMS_VER)
+# define MSGPACK_OS_VMS MSGPACK_PREDEF_MAKE_10_VVRR00PP00(__VMS_VER)
+# else
+# define MSGPACK_OS_VMS MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#if MSGPACK_OS_VMS
+# define MSGPACK_OS_VMS_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_VMS_NAME "VMS"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_VMS,MSGPACK_OS_VMS_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/os/windows.h b/include/msgpack/predef/os/windows.h
new file mode 100644
index 0000000..fc86df9
--- /dev/null
+++ b/include/msgpack/predef/os/windows.h
@@ -0,0 +1,51 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_OS_WINDOWS_H
+#define MSGPACK_PREDEF_OS_WINDOWS_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_OS_WINDOWS`]
+
+[@http://en.wikipedia.org/wiki/Category:Microsoft_Windows Microsoft Windows] operating system.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`_WIN32`] [__predef_detection__]]
+ [[`_WIN64`] [__predef_detection__]]
+ [[`__WIN32__`] [__predef_detection__]]
+ [[`__TOS_WIN__`] [__predef_detection__]]
+ [[`__WINDOWS__`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_OS_WINDOWS MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
+ defined(_WIN32) || defined(_WIN64) || \
+ defined(__WIN32__) || defined(__TOS_WIN__) || \
+ defined(__WINDOWS__) \
+ )
+# undef MSGPACK_OS_WINDOWS
+# define MSGPACK_OS_WINDOWS MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_OS_WINDOWS
+# define MSGPACK_OS_WINDOWS_AVAILABLE
+# include <msgpack/predef/detail/os_detected.h>
+#endif
+
+#define MSGPACK_OS_WINDOWS_NAME "Microsoft Windows"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_OS_WINDOWS,MSGPACK_OS_WINDOWS_NAME)
+
+#endif
diff --git a/include/msgpack/predef/other.h b/include/msgpack/predef/other.h
new file mode 100644
index 0000000..99b32ca
--- /dev/null
+++ b/include/msgpack/predef/other.h
@@ -0,0 +1,14 @@
+/*
+Copyright Rene Rivera 2013
+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_OTHER_H
+#define MSGPACK_PREDEF_OTHER_H
+
+#include <msgpack/predef/other/endian.h>
+/*#include <msgpack/predef/other/.h>*/
+
+#endif
diff --git a/include/msgpack/predef/other/endian.h b/include/msgpack/predef/other/endian.h
new file mode 100644
index 0000000..556e485
--- /dev/null
+++ b/include/msgpack/predef/other/endian.h
@@ -0,0 +1,205 @@
+/*
+Copyright Rene Rivera 2013-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_ENDIAN_H
+#define MSGPACK_PREDEF_ENDIAN_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+#include <msgpack/predef/library/c/gnu.h>
+#include <msgpack/predef/os/macos.h>
+#include <msgpack/predef/os/bsd.h>
+#include <msgpack/predef/os/android.h>
+
+/*`
+[heading `MSGPACK_ENDIAN_*`]
+
+Detection of endian memory ordering. There are four defined macros
+in this header that define the various generally possible endian
+memory orderings:
+
+* `MSGPACK_ENDIAN_BIG_BYTE`, byte-swapped big-endian.
+* `MSGPACK_ENDIAN_BIG_WORD`, word-swapped big-endian.
+* `MSGPACK_ENDIAN_LITTLE_BYTE`, byte-swapped little-endian.
+* `MSGPACK_ENDIAN_LITTLE_WORD`, word-swapped little-endian.
+
+The detection is conservative in that it only identifies endianness
+that it knows for certain. In particular bi-endianness is not
+indicated as is it not practically possible to determine the
+endianness from anything but an operating system provided
+header. And the currently known headers do not define that
+programatic bi-endianness is available.
+
+This implementation is a compilation of various publicly available
+information and acquired knowledge:
+
+# The indispensable documentation of "Pre-defined Compiler Macros"
+ [@http://sourceforge.net/p/predef/wiki/Endianness Endianness].
+# The various endian specifications available in the
+ [@http://wikipedia.org/ Wikipedia] computer architecture pages.
+# Generally available searches for headers that define endianness.
+ */
+
+#define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+#define MSGPACK_ENDIAN_BIG_WORD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+#define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+#define MSGPACK_ENDIAN_LITTLE_WORD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+/* GNU libc provides a header defining __BYTE_ORDER, or _BYTE_ORDER.
+ * And some OSs provide some for of endian header also.
+ */
+#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
+ !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
+# if MSGPACK_LIB_C_GNU || MSGPACK_OS_ANDROID
+# include <endian.h>
+# else
+# if MSGPACK_OS_MACOS
+# include <machine/endian.h>
+# else
+# if MSGPACK_OS_BSD
+# if MSGPACK_OS_BSD_OPEN
+# include <machine/endian.h>
+# else
+# include <sys/endian.h>
+# endif
+# endif
+# endif
+# endif
+# if defined(__BYTE_ORDER)
+# if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)
+# undef MSGPACK_ENDIAN_BIG_BYTE
+# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN)
+# undef MSGPACK_ENDIAN_LITTLE_BYTE
+# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN)
+# undef MSGPACK_ENDIAN_LITTLE_WORD
+# define MSGPACK_ENDIAN_LITTLE_WORD MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
+# if !defined(__BYTE_ORDER) && defined(_BYTE_ORDER)
+# if defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN)
+# undef MSGPACK_ENDIAN_BIG_BYTE
+# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN)
+# undef MSGPACK_ENDIAN_LITTLE_BYTE
+# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# if defined(_PDP_ENDIAN) && (_BYTE_ORDER == _PDP_ENDIAN)
+# undef MSGPACK_ENDIAN_LITTLE_WORD
+# define MSGPACK_ENDIAN_LITTLE_WORD MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
+#endif
+
+/* Built-in byte-swpped big-endian macros.
+ */
+#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
+ !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
+# if (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \
+ (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) || \
+ defined(__ARMEB__) || \
+ defined(__THUMBEB__) || \
+ defined(__AARCH64EB__) || \
+ defined(_MIPSEB) || \
+ defined(__MIPSEB) || \
+ defined(__MIPSEB__)
+# undef MSGPACK_ENDIAN_BIG_BYTE
+# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+/* Built-in byte-swpped little-endian macros.
+ */
+#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
+ !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
+# if (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
+ (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || \
+ defined(__ARMEL__) || \
+ defined(__THUMBEL__) || \
+ defined(__AARCH64EL__) || \
+ defined(_MIPSEL) || \
+ defined(__MIPSEL) || \
+ defined(__MIPSEL__)
+# undef MSGPACK_ENDIAN_LITTLE_BYTE
+# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+/* Some architectures are strictly one endianess (as opposed
+ * the current common bi-endianess).
+ */
+#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
+ !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
+# include <msgpack/predef/architecture.h>
+# if MSGPACK_ARCH_M68K || \
+ MSGPACK_ARCH_PARISK || \
+ MSGPACK_ARCH_SPARC || \
+ MSGPACK_ARCH_SYS370 || \
+ MSGPACK_ARCH_SYS390 || \
+ MSGPACK_ARCH_Z
+# undef MSGPACK_ENDIAN_BIG_BYTE
+# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# if MSGPACK_ARCH_AMD64 || \
+ MSGPACK_ARCH_IA64 || \
+ MSGPACK_ARCH_X86 || \
+ MSGPACK_ARCH_BLACKFIN
+# undef MSGPACK_ENDIAN_LITTLE_BYTE
+# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+/* Windows on ARM, if not otherwise detected/specified, is always
+ * byte-swaped little-endian.
+ */
+#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
+ !MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
+# if MSGPACK_ARCH_ARM
+# include <msgpack/predef/os/windows.h>
+# if MSGPACK_OS_WINDOWS
+# undef MSGPACK_ENDIAN_LITTLE_BYTE
+# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+# endif
+#endif
+
+#if MSGPACK_ENDIAN_BIG_BYTE
+# define MSGPACK_ENDIAN_BIG_BYTE_AVAILABLE
+#endif
+#if MSGPACK_ENDIAN_BIG_WORD
+# define MSGPACK_ENDIAN_BIG_WORD_BYTE_AVAILABLE
+#endif
+#if MSGPACK_ENDIAN_LITTLE_BYTE
+# define MSGPACK_ENDIAN_LITTLE_BYTE_AVAILABLE
+#endif
+#if MSGPACK_ENDIAN_LITTLE_WORD
+# define MSGPACK_ENDIAN_LITTLE_WORD_BYTE_AVAILABLE
+#endif
+
+#define MSGPACK_ENDIAN_BIG_BYTE_NAME "Byte-Swapped Big-Endian"
+#define MSGPACK_ENDIAN_BIG_WORD_NAME "Word-Swapped Big-Endian"
+#define MSGPACK_ENDIAN_LITTLE_BYTE_NAME "Byte-Swapped Little-Endian"
+#define MSGPACK_ENDIAN_LITTLE_WORD_NAME "Word-Swapped Little-Endian"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_BIG_BYTE,MSGPACK_ENDIAN_BIG_BYTE_NAME)
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_BIG_WORD,MSGPACK_ENDIAN_BIG_WORD_NAME)
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_LITTLE_BYTE,MSGPACK_ENDIAN_LITTLE_BYTE_NAME)
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_LITTLE_WORD,MSGPACK_ENDIAN_LITTLE_WORD_NAME)
+
+
+#endif
diff --git a/include/msgpack/predef/platform.h b/include/msgpack/predef/platform.h
new file mode 100644
index 0000000..9029820
--- /dev/null
+++ b/include/msgpack/predef/platform.h
@@ -0,0 +1,19 @@
+/*
+Copyright Rene Rivera 2013
+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_PLATFORM_H
+#define MSGPACK_PREDEF_PLATFORM_H
+
+#include <msgpack/predef/platform/mingw.h>
+#include <msgpack/predef/platform/windows_desktop.h>
+#include <msgpack/predef/platform/windows_store.h>
+#include <msgpack/predef/platform/windows_phone.h>
+#include <msgpack/predef/platform/windows_runtime.h>
+/*#include <msgpack/predef/platform/.h>*/
+
+#endif
diff --git a/include/msgpack/predef/platform/mingw.h b/include/msgpack/predef/platform/mingw.h
new file mode 100644
index 0000000..8410d3d
--- /dev/null
+++ b/include/msgpack/predef/platform/mingw.h
@@ -0,0 +1,70 @@
+/*
+Copyright Rene Rivera 2008-2013
+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_MINGW_H
+#define MSGPACK_PREDEF_COMPILER_MINGW_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+
+/*`
+[heading `MSGPACK_PLAT_MINGW`]
+
+[@http://en.wikipedia.org/wiki/MinGW MinGW] platform.
+Version number available as major, minor, and patch.
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`__MINGW32__`] [__predef_detection__]]
+ [[`__MINGW64__`] [__predef_detection__]]
+
+ [[`__MINGW64_VERSION_MAJOR`, `__MINGW64_VERSION_MINOR`] [V.R.0]]
+ [[`__MINGW32_VERSION_MAJOR`, `__MINGW32_VERSION_MINOR`] [V.R.0]]
+ ]
+ */
+
+#define MSGPACK_PLAT_MINGW MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__MINGW32__) || defined(__MINGW64__)
+# include <_mingw.h>
+# if !defined(MSGPACK_PLAT_MINGW_DETECTION) && (defined(__MINGW64_VERSION_MAJOR) && defined(__MINGW64_VERSION_MINOR))
+# define MSGPACK_PLAT_MINGW_DETECTION \
+ MSGPACK_VERSION_NUMBER(__MINGW64_VERSION_MAJOR,__MINGW64_VERSION_MINOR,0)
+# endif
+# if !defined(MSGPACK_PLAT_MINGW_DETECTION) && (defined(__MINGW32_VERSION_MAJOR) && defined(__MINGW32_VERSION_MINOR))
+# define MSGPACK_PLAT_MINGW_DETECTION \
+ MSGPACK_VERSION_NUMBER(__MINGW32_MAJOR_VERSION,__MINGW32_MINOR_VERSION,0)
+# endif
+# if !defined(MSGPACK_PLAT_MINGW_DETECTION)
+# define MSGPACK_PLAT_MINGW_DETECTION MSGPACK_VERSION_NUMBER_AVAILABLE
+# endif
+#endif
+
+#ifdef MSGPACK_PLAT_MINGW_DETECTION
+# define MSGPACK_PLAT_MINGW_AVAILABLE
+# if defined(MSGPACK_PREDEF_DETAIL_PLAT_DETECTED)
+# define MSGPACK_PLAT_MINGW_EMULATED MSGPACK_PLAT_MINGW_DETECTION
+# else
+# undef MSGPACK_PLAT_MINGW
+# define MSGPACK_PLAT_MINGW MSGPACK_PLAT_MINGW_DETECTION
+# endif
+# include <msgpack/predef/detail/platform_detected.h>
+#endif
+
+#define MSGPACK_PLAT_MINGW_NAME "MinGW"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW,MSGPACK_PLAT_MINGW_NAME)
+
+#ifdef MSGPACK_PLAT_MINGW_EMULATED
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_MINGW_EMULATED,MSGPACK_PLAT_MINGW_NAME)
+#endif
+
+
+#endif
diff --git a/include/msgpack/predef/platform/windows_desktop.h b/include/msgpack/predef/platform/windows_desktop.h
new file mode 100644
index 0000000..93a96cb
--- /dev/null
+++ b/include/msgpack/predef/platform/windows_desktop.h
@@ -0,0 +1,44 @@
+/*
+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_PLAT_WINDOWS_DESKTOP_H
+#define MSGPACK_PREDEF_PLAT_WINDOWS_DESKTOP_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+#include <msgpack/predef/os/windows.h>
+
+/*`
+[heading `MSGPACK_PLAT_WINDOWS_DESKTOP`]
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`!WINAPI_FAMILY`] [__predef_detection__]]
+ [[`WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_PLAT_WINDOWS_DESKTOP MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if MSGPACK_OS_WINDOWS && \
+ ( !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) )
+# undef MSGPACK_PLAT_WINDOWS_DESKTOP
+# define MSGPACK_PLAT_WINDOWS_DESKTOP MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_PLAT_WINDOWS_DESKTOP
+# define MSGPACK_PLAT_WINDOWS_DESKTOP_AVALIABLE
+# include <msgpack/predef/detail/platform_detected.h>
+#endif
+
+#define MSGPACK_PLAT_WINDOWS_DESKTOP_NAME "Windows Desktop"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_DESKTOP,MSGPACK_PLAT_WINDOWS_DESKTOP_NAME)
+
+#endif
diff --git a/include/msgpack/predef/platform/windows_phone.h b/include/msgpack/predef/platform/windows_phone.h
new file mode 100644
index 0000000..ccccfbb
--- /dev/null
+++ b/include/msgpack/predef/platform/windows_phone.h
@@ -0,0 +1,42 @@
+/*
+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_PLAT_WINDOWS_PHONE_H
+#define MSGPACK_PREDEF_PLAT_WINDOWS_PHONE_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+#include <msgpack/predef/os/windows.h>
+
+/*`
+[heading `MSGPACK_PLAT_WINDOWS_PHONE`]
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_PLAT_WINDOWS_PHONE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if MSGPACK_OS_WINDOWS && defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
+# undef MSGPACK_PLAT_WINDOWS_PHONE
+# define MSGPACK_PLAT_WINDOWS_PHONE MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_PLAT_WINDOWS_PHONE
+# define MSGPACK_PLAT_WINDOWS_PHONE_AVALIABLE
+# include <msgpack/predef/detail/platform_detected.h>
+#endif
+
+#define MSGPACK_PLAT_WINDOWS_PHONE_NAME "Windows Phone"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_PHONE,MSGPACK_PLAT_WINDOWS_PHONE_NAME)
+
+#endif
diff --git a/include/msgpack/predef/platform/windows_runtime.h b/include/msgpack/predef/platform/windows_runtime.h
new file mode 100644
index 0000000..d93f153
--- /dev/null
+++ b/include/msgpack/predef/platform/windows_runtime.h
@@ -0,0 +1,44 @@
+/*
+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_PLAT_WINDOWS_RUNTIME_H
+#define MSGPACK_PREDEF_PLAT_WINDOWS_RUNTIME_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+#include <msgpack/predef/os/windows.h>
+
+/*`
+[heading `MSGPACK_PLAT_WINDOWS_RUNTIME`]
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`WINAPI_FAMILY == WINAPI_FAMILY_APP`] [__predef_detection__]]
+ [[`WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_PLAT_WINDOWS_RUNTIME MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if MSGPACK_OS_WINDOWS && defined(WINAPI_FAMILY) && \
+ ( WINAPI_FAMILY == WINAPI_FAMILY_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP )
+# undef MSGPACK_PLAT_WINDOWS_RUNTIME
+# define MSGPACK_PLAT_WINDOWS_RUNTIME MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_PLAT_WINDOWS_RUNTIME
+# define MSGPACK_PLAT_WINDOWS_RUNTIME_AVALIABLE
+# include <msgpack/predef/detail/platform_detected.h>
+#endif
+
+#define MSGPACK_PLAT_WINDOWS_RUNTIME_NAME "Windows Runtime"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_RUNTIME,MSGPACK_PLAT_WINDOWS_RUNTIME_NAME)
+
+#endif
diff --git a/include/msgpack/predef/platform/windows_store.h b/include/msgpack/predef/platform/windows_store.h
new file mode 100644
index 0000000..005f4ec
--- /dev/null
+++ b/include/msgpack/predef/platform/windows_store.h
@@ -0,0 +1,42 @@
+/*
+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_PLAT_WINDOWS_STORE_H
+#define MSGPACK_PREDEF_PLAT_WINDOWS_STORE_H
+
+#include <msgpack/predef/version_number.h>
+#include <msgpack/predef/make.h>
+#include <msgpack/predef/os/windows.h>
+
+/*`
+[heading `MSGPACK_PLAT_WINDOWS_STORE`]
+
+[table
+ [[__predef_symbol__] [__predef_version__]]
+
+ [[`WINAPI_FAMILY == WINAPI_FAMILY_APP`] [__predef_detection__]]
+ ]
+ */
+
+#define MSGPACK_PLAT_WINDOWS_STORE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
+
+#if MSGPACK_OS_WINDOWS && defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP
+# undef MSGPACK_PLAT_WINDOWS_STORE
+# define MSGPACK_PLAT_WINDOWS_STORE MSGPACK_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if MSGPACK_PLAT_WINDOWS_STORE
+# define MSGPACK_PLAT_WINDOWS_STORE_AVALIABLE
+# include <msgpack/predef/detail/platform_detected.h>
+#endif
+
+#define MSGPACK_PLAT_WINDOWS_STORE_NAME "Windows Store"
+
+#include <msgpack/predef/detail/test.h>
+MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_STORE,MSGPACK_PLAT_WINDOWS_STORE_NAME)
+
+#endif
diff --git a/include/msgpack/predef/version.h b/include/msgpack/predef/version.h
new file mode 100644
index 0000000..3910b96
--- /dev/null
+++ b/include/msgpack/predef/version.h
@@ -0,0 +1,15 @@
+/*
+Copyright Rene Rivera 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_VERSION_H
+#define MSGPACK_PREDEF_VERSION_H
+
+#include <msgpack/predef/version_number.h>
+
+#define MSGPACK_PREDEF_VERSION MSGPACK_VERSION_NUMBER(1,2,0)
+
+#endif
diff --git a/include/msgpack/predef/version_number.h b/include/msgpack/predef/version_number.h
new file mode 100644
index 0000000..37af5d2
--- /dev/null
+++ b/include/msgpack/predef/version_number.h
@@ -0,0 +1,54 @@
+/*
+Copyright Rene Rivera 2005
+Copyright Rene Rivera 2008-2013
+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_VERSION_NUMBER_H
+#define MSGPACK_PREDEF_VERSION_NUMBER_H
+
+/*`
+[heading `MSGPACK_VERSION_NUMBER`]
+
+``
+MSGPACK_VERSION_NUMBER(major,minor,patch)
+``
+
+Defines standard version numbers, with these properties:
+
+* Decimal base whole numbers in the range \[0,1000000000).
+ The number range is designed to allow for a (2,2,5) triplet.
+ Which fits within a 32 bit value.
+* The `major` number can be in the \[0,99\] range.
+* The `minor` number can be in the \[0,99\] range.
+* The `patch` number can be in the \[0,99999\] range.
+* Values can be specified in any base. As the defined value
+ is an constant expression.
+* Value can be directly used in both preprocessor and compiler
+ expressions for comparison to other similarly defined values.
+* The implementation enforces the individual ranges for the
+ major, minor, and patch numbers. And values over the ranges
+ are truncated (modulo).
+
+*/
+#define MSGPACK_VERSION_NUMBER(major,minor,patch) \
+ ( (((major)%100)*10000000) + (((minor)%100)*100000) + ((patch)%100000) )
+
+#define MSGPACK_VERSION_NUMBER_MAX \
+ MSGPACK_VERSION_NUMBER(99,99,99999)
+
+#define MSGPACK_VERSION_NUMBER_ZERO \
+ MSGPACK_VERSION_NUMBER(0,0,0)
+
+#define MSGPACK_VERSION_NUMBER_MIN \
+ MSGPACK_VERSION_NUMBER(0,0,1)
+
+#define MSGPACK_VERSION_NUMBER_AVAILABLE \
+ MSGPACK_VERSION_NUMBER_MIN
+
+#define MSGPACK_VERSION_NUMBER_NOT_AVAILABLE \
+ MSGPACK_VERSION_NUMBER_ZERO
+
+#endif
diff --git a/include/msgpack/sysdep.h b/include/msgpack/sysdep.h
index 4fedbd8..a3f9edc 100644
--- a/include/msgpack/sysdep.h
+++ b/include/msgpack/sysdep.h
@@ -3,176 +3,154 @@
*
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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_SYSDEP_H__
-#define MSGPACK_SYSDEP_H__
+#ifndef MSGPACK_SYSDEP_H
+#define MSGPACK_SYSDEP_H
+
+#include <msgpack/predef.h>
#include <stdlib.h>
#include <stddef.h>
#if defined(_MSC_VER) && _MSC_VER < 1600
-typedef __int8 int8_t;
-typedef unsigned __int8 uint8_t;
-typedef __int16 int16_t;
-typedef unsigned __int16 uint16_t;
-typedef __int32 int32_t;
-typedef unsigned __int32 uint32_t;
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
+ typedef __int8 int8_t;
+ typedef unsigned __int8 uint8_t;
+ typedef __int16 int16_t;
+ typedef unsigned __int16 uint16_t;
+ typedef __int32 int32_t;
+ typedef unsigned __int32 uint32_t;
+ typedef __int64 int64_t;
+ typedef unsigned __int64 uint64_t;
#elif defined(_MSC_VER) // && _MSC_VER >= 1600
-#include <stdint.h>
+# include <stdint.h>
#else
-#include <stdint.h>
-#include <stdbool.h>
+# include <stdint.h>
+# include <stdbool.h>
#endif
-#ifdef _WIN32
-#define _msgpack_atomic_counter_header <windows.h>
-typedef long _msgpack_atomic_counter_t;
-#define _msgpack_sync_decr_and_fetch(ptr) InterlockedDecrement(ptr)
-#define _msgpack_sync_incr_and_fetch(ptr) InterlockedIncrement(ptr)
-#elif defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41)
-#define _msgpack_atomic_counter_header "gcc_atomic.h"
-#else
-typedef unsigned int _msgpack_atomic_counter_t;
-#define _msgpack_sync_decr_and_fetch(ptr) __sync_sub_and_fetch(ptr, 1)
-#define _msgpack_sync_incr_and_fetch(ptr) __sync_add_and_fetch(ptr, 1)
+#if !defined(MSGPACK_DLLEXPORT)
+#if defined(_MSC_VER)
+# define MSGPACK_DLLEXPORT __declspec(dllexport)
+#else /* _MSC_VER */
+# define MSGPACK_DLLEXPORT
+#endif /* _MSC_VER */
#endif
#ifdef _WIN32
+# define _msgpack_atomic_counter_header <windows.h>
+ typedef long _msgpack_atomic_counter_t;
+# define _msgpack_sync_decr_and_fetch(ptr) InterlockedDecrement(ptr)
+# define _msgpack_sync_incr_and_fetch(ptr) InterlockedIncrement(ptr)
+#elif defined(__GNUC__) && ((__GNUC__*10 + __GNUC_MINOR__) < 41)
-#ifdef __cplusplus
-/* numeric_limits<T>::min,max */
-#ifdef max
-#undef max
-#endif
-#ifdef min
-#undef min
-#endif
-#endif
+# if defined(__cplusplus)
+# define _msgpack_atomic_counter_header "gcc_atomic.hpp"
+# else
+# define _msgpack_atomic_counter_header "gcc_atomic.h"
+# endif
#else
-#include <arpa/inet.h> /* __BYTE_ORDER */
+ typedef unsigned int _msgpack_atomic_counter_t;
+# define _msgpack_sync_decr_and_fetch(ptr) __sync_sub_and_fetch(ptr, 1)
+# define _msgpack_sync_incr_and_fetch(ptr) __sync_add_and_fetch(ptr, 1)
#endif
-#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define __LITTLE_ENDIAN__
-#elif __BYTE_ORDER == __BIG_ENDIAN
-#define __BIG_ENDIAN__
-#elif _WIN32
-#define __LITTLE_ENDIAN__
-#endif
-#endif
+#ifdef _WIN32
+# ifdef __cplusplus
+ /* numeric_limits<T>::min,max */
+# ifdef max
+# undef max
+# endif
+# ifdef min
+# undef min
+# endif
+# endif
-#ifdef __LITTLE_ENDIAN__
+#else /* _*/
-#ifdef _WIN32
-# if defined(ntohs)
-# define _msgpack_be16(x) ntohs(x)
-# elif defined(_byteswap_ushort) || (defined(_MSC_VER) && _MSC_VER >= 1400)
-# define _msgpack_be16(x) ((uint16_t)_byteswap_ushort((unsigned short)x))
-# else
-# define _msgpack_be16(x) ( \
- ((((uint16_t)x) << 8) ) | \
- ((((uint16_t)x) >> 8) ) )
-# endif
-#else
-# define _msgpack_be16(x) ntohs(x)
-#endif
-
-#ifdef _WIN32
-# if defined(ntohl)
-# define _msgpack_be32(x) ntohl(x)
-# elif defined(_byteswap_ulong) || (defined(_MSC_VER) && _MSC_VER >= 1400)
-# define _msgpack_be32(x) ((uint32_t)_byteswap_ulong((unsigned long)x))
-# else
-# define _msgpack_be32(x) \
- ( ((((uint32_t)x) << 24) ) | \
- ((((uint32_t)x) << 8) & 0x00ff0000U ) | \
- ((((uint32_t)x) >> 8) & 0x0000ff00U ) | \
- ((((uint32_t)x) >> 24) ) )
-# endif
-#else
-# define _msgpack_be32(x) ntohl(x)
-#endif
+#include <arpa/inet.h> /* __BYTE_ORDER */
+# if defined(linux)
+# include <byteswap.h>
+# endif
-#if defined(_byteswap_uint64) || (defined(_MSC_VER) && _MSC_VER >= 1400)
-# define _msgpack_be64(x) (_byteswap_uint64(x))
-#elif defined(bswap_64)
-# define _msgpack_be64(x) bswap_64(x)
-#elif defined(__DARWIN_OSSwapInt64)
-# define _msgpack_be64(x) __DARWIN_OSSwapInt64(x)
-#else
-#define _msgpack_be64(x) \
- ( ((((uint64_t)x) << 56) ) | \
- ((((uint64_t)x) << 40) & 0x00ff000000000000ULL ) | \
- ((((uint64_t)x) << 24) & 0x0000ff0000000000ULL ) | \
- ((((uint64_t)x) << 8) & 0x000000ff00000000ULL ) | \
- ((((uint64_t)x) >> 8) & 0x00000000ff000000ULL ) | \
- ((((uint64_t)x) >> 24) & 0x0000000000ff0000ULL ) | \
- ((((uint64_t)x) >> 40) & 0x000000000000ff00ULL ) | \
- ((((uint64_t)x) >> 56) ) )
#endif
-#define _msgpack_load16(cast, from) ((cast)( \
- (((uint16_t)((uint8_t*)(from))[0]) << 8) | \
- (((uint16_t)((uint8_t*)(from))[1]) ) ))
-
-#define _msgpack_load32(cast, from) ((cast)( \
- (((uint32_t)((uint8_t*)(from))[0]) << 24) | \
- (((uint32_t)((uint8_t*)(from))[1]) << 16) | \
- (((uint32_t)((uint8_t*)(from))[2]) << 8) | \
- (((uint32_t)((uint8_t*)(from))[3]) ) ))
-
-#define _msgpack_load64(cast, from) ((cast)( \
- (((uint64_t)((uint8_t*)(from))[0]) << 56) | \
- (((uint64_t)((uint8_t*)(from))[1]) << 48) | \
- (((uint64_t)((uint8_t*)(from))[2]) << 40) | \
- (((uint64_t)((uint8_t*)(from))[3]) << 32) | \
- (((uint64_t)((uint8_t*)(from))[4]) << 24) | \
- (((uint64_t)((uint8_t*)(from))[5]) << 16) | \
- (((uint64_t)((uint8_t*)(from))[6]) << 8) | \
- (((uint64_t)((uint8_t*)(from))[7]) ) ))
+#if MSGPACK_ENDIAN_LITTLE_BYTE
+
+# ifdef _WIN32
+# if defined(ntohs)
+# define _msgpack_be16(x) ntohs(x)
+# elif defined(_byteswap_ushort) || (defined(_MSC_VER) && _MSC_VER >= 1400)
+# define _msgpack_be16(x) ((uint16_t)_byteswap_ushort((unsigned short)x))
+# else
+# define _msgpack_be16(x) ( \
+ ((((uint16_t)x) << 8) ) | \
+ ((((uint16_t)x) >> 8) ) )
+# endif
+# else
+# define _msgpack_be16(x) ntohs(x)
+# endif
+
+# ifdef _WIN32
+# if defined(ntohl)
+# define _msgpack_be32(x) ntohl(x)
+# elif defined(_byteswap_ulong) || (defined(_MSC_VER) && _MSC_VER >= 1400)
+# define _msgpack_be32(x) ((uint32_t)_byteswap_ulong((unsigned long)x))
+# else
+# define _msgpack_be32(x) \
+ ( ((((uint32_t)x) << 24) ) | \
+ ((((uint32_t)x) << 8) & 0x00ff0000U ) | \
+ ((((uint32_t)x) >> 8) & 0x0000ff00U ) | \
+ ((((uint32_t)x) >> 24) ) )
+# endif
+# else
+# define _msgpack_be32(x) ntohl(x)
+# endif
+
+# if defined(_byteswap_uint64) || (defined(_MSC_VER) && _MSC_VER >= 1400)
+# define _msgpack_be64(x) (_byteswap_uint64(x))
+# elif defined(bswap_64)
+# define _msgpack_be64(x) bswap_64(x)
+# elif defined(__DARWIN_OSSwapInt64)
+# define _msgpack_be64(x) __DARWIN_OSSwapInt64(x)
+# else
+# define _msgpack_be64(x) \
+ ( ((((uint64_t)x) << 56) ) | \
+ ((((uint64_t)x) << 40) & 0x00ff000000000000ULL ) | \
+ ((((uint64_t)x) << 24) & 0x0000ff0000000000ULL ) | \
+ ((((uint64_t)x) << 8) & 0x000000ff00000000ULL ) | \
+ ((((uint64_t)x) >> 8) & 0x00000000ff000000ULL ) | \
+ ((((uint64_t)x) >> 24) & 0x0000000000ff0000ULL ) | \
+ ((((uint64_t)x) >> 40) & 0x000000000000ff00ULL ) | \
+ ((((uint64_t)x) >> 56) ) )
+# endif
+
+#elif MSGPACK_ENDIAN_BIG_BYTE
+
+# define _msgpack_be16(x) (x)
+# define _msgpack_be32(x) (x)
+# define _msgpack_be64(x) (x)
#else
-
-#define _msgpack_be16(x) (x)
-#define _msgpack_be32(x) (x)
-#define _msgpack_be64(x) (x)
-
-#define _msgpack_load16(cast, from) ((cast)( \
- (((uint16_t)((uint8_t*)from)[0]) << 8) | \
- (((uint16_t)((uint8_t*)from)[1]) ) ))
-
-#define _msgpack_load32(cast, from) ((cast)( \
- (((uint32_t)((uint8_t*)from)[0]) << 24) | \
- (((uint32_t)((uint8_t*)from)[1]) << 16) | \
- (((uint32_t)((uint8_t*)from)[2]) << 8) | \
- (((uint32_t)((uint8_t*)from)[3]) ) ))
-
-#define _msgpack_load64(cast, from) ((cast)( \
- (((uint64_t)((uint8_t*)from)[0]) << 56) | \
- (((uint64_t)((uint8_t*)from)[1]) << 48) | \
- (((uint64_t)((uint8_t*)from)[2]) << 40) | \
- (((uint64_t)((uint8_t*)from)[3]) << 32) | \
- (((uint64_t)((uint8_t*)from)[4]) << 24) | \
- (((uint64_t)((uint8_t*)from)[5]) << 16) | \
- (((uint64_t)((uint8_t*)from)[6]) << 8) | \
- (((uint64_t)((uint8_t*)from)[7]) ) ))
-#endif
-
+# error msgpack-c supports only big endian and little endian
+#endif /* MSGPACK_ENDIAN_LITTLE_BYTE */
+
+#define _msgpack_load16(cast, from, to) do { \
+ memcpy((cast*)(to), (from), sizeof(cast)); \
+ *(to) = _msgpack_be16(*(to)); \
+ } while (0);
+
+#define _msgpack_load32(cast, from, to) do { \
+ memcpy((cast*)(to), (from), sizeof(cast)); \
+ *(to) = _msgpack_be32(*(to)); \
+ } while (0);
+#define _msgpack_load64(cast, from, to) do { \
+ memcpy((cast*)(to), (from), sizeof(cast)); \
+ *(to) = _msgpack_be64(*(to)); \
+ } while (0);
#define _msgpack_store16(to, num) \
do { uint16_t val = _msgpack_be16(num); memcpy(to, &val, 2); } while(0)
@@ -191,5 +169,21 @@ typedef unsigned int _msgpack_atomic_counter_t;
*/
-#endif /* msgpack/sysdep.h */
+#if !defined(__cplusplus) && defined(_MSC_VER)
+# if !defined(FALSE)
+# define FALSE (0)
+# endif
+# if !defined(TRUE)
+# define TRUE (!FALSE)
+# endif
+# if _MSC_VER >= 1800
+# include <stdbool.h>
+# else
+# define bool int
+# define true TRUE
+# define false FALSE
+# endif
+# define inline __inline
+#endif
+#endif /* msgpack/sysdep.h */
diff --git a/include/msgpack/unpack.h b/include/msgpack/unpack.h
new file mode 100644
index 0000000..0f9aede
--- /dev/null
+++ b/include/msgpack/unpack.h
@@ -0,0 +1,270 @@
+/*
+ * MessagePack for C unpacking 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_UNPACKER_H
+#define MSGPACK_UNPACKER_H
+
+#include "zone.h"
+#include "object.h"
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * @defgroup msgpack_unpack Deserializer
+ * @ingroup msgpack
+ * @{
+ */
+
+typedef struct msgpack_unpacked {
+ msgpack_zone* zone;
+ msgpack_object data;
+} msgpack_unpacked;
+
+typedef enum {
+ MSGPACK_UNPACK_SUCCESS = 2,
+ MSGPACK_UNPACK_EXTRA_BYTES = 1,
+ MSGPACK_UNPACK_CONTINUE = 0,
+ MSGPACK_UNPACK_PARSE_ERROR = -1,
+ MSGPACK_UNPACK_NOMEM_ERROR = -2
+} msgpack_unpack_return;
+
+
+MSGPACK_DLLEXPORT
+msgpack_unpack_return
+msgpack_unpack_next(msgpack_unpacked* result,
+ const char* data, size_t len, size_t* off);
+
+/** @} */
+
+
+/**
+ * @defgroup msgpack_unpacker Streaming deserializer
+ * @ingroup msgpack
+ * @{
+ */
+
+typedef struct msgpack_unpacker {
+ char* buffer;
+ size_t used;
+ size_t free;
+ size_t off;
+ size_t parsed;
+ msgpack_zone* z;
+ size_t initial_buffer_size;
+ void* ctx;
+} msgpack_unpacker;
+
+
+#ifndef MSGPACK_UNPACKER_INIT_BUFFER_SIZE
+#define MSGPACK_UNPACKER_INIT_BUFFER_SIZE (64*1024)
+#endif
+
+/**
+ * Initializes a streaming deserializer.
+ * The initialized deserializer must be destroyed by msgpack_unpacker_destroy(msgpack_unpacker*).
+ */
+MSGPACK_DLLEXPORT
+bool msgpack_unpacker_init(msgpack_unpacker* mpac, size_t initial_buffer_size);
+
+/**
+ * Destroys a streaming deserializer initialized by msgpack_unpacker_init(msgpack_unpacker*, size_t).
+ */
+MSGPACK_DLLEXPORT
+void msgpack_unpacker_destroy(msgpack_unpacker* mpac);
+
+
+/**
+ * Creates a streaming deserializer.
+ * The created deserializer must be destroyed by msgpack_unpacker_free(msgpack_unpacker*).
+ */
+MSGPACK_DLLEXPORT
+msgpack_unpacker* msgpack_unpacker_new(size_t initial_buffer_size);
+
+/**
+ * Frees a streaming deserializer created by msgpack_unpacker_new(size_t).
+ */
+MSGPACK_DLLEXPORT
+void msgpack_unpacker_free(msgpack_unpacker* mpac);
+
+
+#ifndef MSGPACK_UNPACKER_RESERVE_SIZE
+#define MSGPACK_UNPACKER_RESERVE_SIZE (32*1024)
+#endif
+
+/**
+ * Reserves free space of the internal buffer.
+ * Use this function to fill the internal buffer with
+ * msgpack_unpacker_buffer(msgpack_unpacker*),
+ * msgpack_unpacker_buffer_capacity(const msgpack_unpacker*) and
+ * msgpack_unpacker_buffer_consumed(msgpack_unpacker*).
+ */
+static inline bool msgpack_unpacker_reserve_buffer(msgpack_unpacker* mpac, size_t size);
+
+/**
+ * Gets pointer to the free space of the internal buffer.
+ * Use this function to fill the internal buffer with
+ * msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t),
+ * msgpack_unpacker_buffer_capacity(const msgpack_unpacker*) and
+ * msgpack_unpacker_buffer_consumed(msgpack_unpacker*).
+ */
+static inline char* msgpack_unpacker_buffer(msgpack_unpacker* mpac);
+
+/**
+ * Gets size of the free space of the internal buffer.
+ * Use this function to fill the internal buffer with
+ * msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t),
+ * msgpack_unpacker_buffer(const msgpack_unpacker*) and
+ * msgpack_unpacker_buffer_consumed(msgpack_unpacker*).
+ */
+static inline size_t msgpack_unpacker_buffer_capacity(const msgpack_unpacker* mpac);
+
+/**
+ * Notifies the deserializer that the internal buffer filled.
+ * Use this function to fill the internal buffer with
+ * msgpack_unpacker_reserve_buffer(msgpack_unpacker*, size_t),
+ * msgpack_unpacker_buffer(msgpack_unpacker*) and
+ * msgpack_unpacker_buffer_capacity(const msgpack_unpacker*).
+ */
+static inline void msgpack_unpacker_buffer_consumed(msgpack_unpacker* mpac, size_t size);
+
+
+/**
+ * Deserializes one object.
+ * Returns true if it successes. Otherwise false is returned.
+ * @param pac pointer to an initialized msgpack_unpacked object.
+ */
+MSGPACK_DLLEXPORT
+msgpack_unpack_return msgpack_unpacker_next(msgpack_unpacker* mpac, msgpack_unpacked* pac);
+
+/**
+ * Initializes a msgpack_unpacked object.
+ * The initialized object must be destroyed by msgpack_unpacked_destroy(msgpack_unpacker*).
+ * Use the object with msgpack_unpacker_next(msgpack_unpacker*, msgpack_unpacked*) or
+ * msgpack_unpack_next(msgpack_unpacked*, const char*, size_t, size_t*).
+ */
+static inline void msgpack_unpacked_init(msgpack_unpacked* result);
+
+/**
+ * Destroys a streaming deserializer initialized by msgpack_unpacked().
+ */
+static inline void msgpack_unpacked_destroy(msgpack_unpacked* result);
+
+/**
+ * Releases the memory zone from msgpack_unpacked object.
+ * The released zone must be freed by msgpack_zone_free(msgpack_zone*).
+ */
+static inline msgpack_zone* msgpack_unpacked_release_zone(msgpack_unpacked* result);
+
+
+MSGPACK_DLLEXPORT
+int msgpack_unpacker_execute(msgpack_unpacker* mpac);
+
+MSGPACK_DLLEXPORT
+msgpack_object msgpack_unpacker_data(msgpack_unpacker* mpac);
+
+MSGPACK_DLLEXPORT
+msgpack_zone* msgpack_unpacker_release_zone(msgpack_unpacker* mpac);
+
+MSGPACK_DLLEXPORT
+void msgpack_unpacker_reset_zone(msgpack_unpacker* mpac);
+
+MSGPACK_DLLEXPORT
+void msgpack_unpacker_reset(msgpack_unpacker* mpac);
+
+static inline size_t msgpack_unpacker_message_size(const msgpack_unpacker* mpac);
+
+
+/** @} */
+
+
+// obsolete
+MSGPACK_DLLEXPORT
+msgpack_unpack_return
+msgpack_unpack(const char* data, size_t len, size_t* off,
+ msgpack_zone* result_zone, msgpack_object* result);
+
+
+
+
+static inline size_t msgpack_unpacker_parsed_size(const msgpack_unpacker* mpac);
+
+MSGPACK_DLLEXPORT
+bool msgpack_unpacker_flush_zone(msgpack_unpacker* mpac);
+
+MSGPACK_DLLEXPORT
+bool msgpack_unpacker_expand_buffer(msgpack_unpacker* mpac, size_t size);
+
+static inline bool msgpack_unpacker_reserve_buffer(msgpack_unpacker* mpac, size_t size)
+{
+ if(mpac->free >= size) { return true; }
+ return msgpack_unpacker_expand_buffer(mpac, size);
+}
+
+static inline char* msgpack_unpacker_buffer(msgpack_unpacker* mpac)
+{
+ return mpac->buffer + mpac->used;
+}
+
+static inline size_t msgpack_unpacker_buffer_capacity(const msgpack_unpacker* mpac)
+{
+ return mpac->free;
+}
+
+static inline void msgpack_unpacker_buffer_consumed(msgpack_unpacker* mpac, size_t size)
+{
+ mpac->used += size;
+ mpac->free -= size;
+}
+
+static inline size_t msgpack_unpacker_message_size(const msgpack_unpacker* mpac)
+{
+ return mpac->parsed - mpac->off + mpac->used;
+}
+
+static inline size_t msgpack_unpacker_parsed_size(const msgpack_unpacker* mpac)
+{
+ return mpac->parsed;
+}
+
+
+static inline void msgpack_unpacked_init(msgpack_unpacked* result)
+{
+ memset(result, 0, sizeof(msgpack_unpacked));
+}
+
+static inline void msgpack_unpacked_destroy(msgpack_unpacked* result)
+{
+ if(result->zone != NULL) {
+ msgpack_zone_free(result->zone);
+ result->zone = NULL;
+ memset(&result->data, 0, sizeof(msgpack_object));
+ }
+}
+
+static inline msgpack_zone* msgpack_unpacked_release_zone(msgpack_unpacked* result)
+{
+ if(result->zone != NULL) {
+ msgpack_zone* z = result->zone;
+ result->zone = NULL;
+ return z;
+ }
+ return NULL;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* msgpack/unpack.h */
+
diff --git a/include/msgpack/unpack_define.h b/include/msgpack/unpack_define.h
index 959d351..c7decf6 100644
--- a/include/msgpack/unpack_define.h
+++ b/include/msgpack/unpack_define.h
@@ -3,20 +3,12 @@
*
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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_UNPACK_DEFINE_H__
-#define MSGPACK_UNPACK_DEFINE_H__
+#ifndef MSGPACK_UNPACK_DEFINE_H
+#define MSGPACK_UNPACK_DEFINE_H
#include "msgpack/sysdep.h"
#include <stdlib.h>
@@ -35,53 +27,57 @@ extern "C" {
typedef enum {
- CS_HEADER = 0x00, // nil
-
- //CS_ = 0x01,
- //CS_ = 0x02, // false
- //CS_ = 0x03, // true
-
- //CS_ = 0x04,
- //CS_ = 0x05,
- //CS_ = 0x06,
- //CS_ = 0x07,
-
- //CS_ = 0x08,
- //CS_ = 0x09,
- CS_FLOAT = 0x0a,
- CS_DOUBLE = 0x0b,
- CS_UINT_8 = 0x0c,
- CS_UINT_16 = 0x0d,
- CS_UINT_32 = 0x0e,
- CS_UINT_64 = 0x0f,
- CS_INT_8 = 0x10,
- CS_INT_16 = 0x11,
- CS_INT_32 = 0x12,
- CS_INT_64 = 0x13,
-
- //CS_ = 0x14,
- //CS_ = 0x15,
- //CS_BIG_INT_16 = 0x16,
- //CS_BIG_INT_32 = 0x17,
- //CS_BIG_FLOAT_16 = 0x18,
- //CS_BIG_FLOAT_32 = 0x19,
- CS_RAW_16 = 0x1a,
- CS_RAW_32 = 0x1b,
- CS_ARRAY_16 = 0x1c,
- CS_ARRAY_32 = 0x1d,
- CS_MAP_16 = 0x1e,
- CS_MAP_32 = 0x1f,
-
- //ACS_BIG_INT_VALUE,
- //ACS_BIG_FLOAT_VALUE,
- ACS_RAW_VALUE,
+ MSGPACK_CS_HEADER = 0x00, // nil
+
+ //MSGPACK_CS_ = 0x01,
+ //MSGPACK_CS_ = 0x02, // false
+ //MSGPACK_CS_ = 0x03, // true
+
+ MSGPACK_CS_BIN_8 = 0x04,
+ MSGPACK_CS_BIN_16 = 0x05,
+ MSGPACK_CS_BIN_32 = 0x06,
+
+ MSGPACK_CS_EXT_8 = 0x07,
+ MSGPACK_CS_EXT_16 = 0x08,
+ MSGPACK_CS_EXT_32 = 0x09,
+
+ MSGPACK_CS_FLOAT = 0x0a,
+ MSGPACK_CS_DOUBLE = 0x0b,
+ MSGPACK_CS_UINT_8 = 0x0c,
+ MSGPACK_CS_UINT_16 = 0x0d,
+ MSGPACK_CS_UINT_32 = 0x0e,
+ MSGPACK_CS_UINT_64 = 0x0f,
+ MSGPACK_CS_INT_8 = 0x10,
+ MSGPACK_CS_INT_16 = 0x11,
+ MSGPACK_CS_INT_32 = 0x12,
+ MSGPACK_CS_INT_64 = 0x13,
+
+ MSGPACK_CS_FIXEXT_1 = 0x14,
+ MSGPACK_CS_FIXEXT_2 = 0x15,
+ MSGPACK_CS_FIXEXT_4 = 0x16,
+ MSGPACK_CS_FIXEXT_8 = 0x17,
+ MSGPACK_CS_FIXEXT_16 = 0x18,
+
+ MSGPACK_CS_STR_8 = 0x19, // str8
+ MSGPACK_CS_STR_16 = 0x1a, // str16
+ MSGPACK_CS_STR_32 = 0x1b, // str32
+ MSGPACK_CS_ARRAY_16 = 0x1c,
+ MSGPACK_CS_ARRAY_32 = 0x1d,
+ MSGPACK_CS_MAP_16 = 0x1e,
+ MSGPACK_CS_MAP_32 = 0x1f,
+
+ //MSGPACK_ACS_BIG_INT_VALUE,
+ //MSGPACK_ACS_BIG_FLOAT_VALUE,
+ MSGPACK_ACS_STR_VALUE,
+ MSGPACK_ACS_BIN_VALUE,
+ MSGPACK_ACS_EXT_VALUE
} msgpack_unpack_state;
typedef enum {
- CT_ARRAY_ITEM,
- CT_MAP_KEY,
- CT_MAP_VALUE,
+ MSGPACK_CT_ARRAY_ITEM,
+ MSGPACK_CT_MAP_KEY,
+ MSGPACK_CT_MAP_VALUE
} msgpack_container_type;
diff --git a/include/msgpack/unpack_template.h b/include/msgpack/unpack_template.h
index 711b163..a6dae6f 100644
--- a/include/msgpack/unpack_template.h
+++ b/include/msgpack/unpack_template.h
@@ -3,17 +3,9 @@
*
* Copyright (C) 2008-2010 FURUHASHI Sadayuki
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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_unpack_func
@@ -47,128 +39,128 @@
#endif
msgpack_unpack_struct_decl(_stack) {
- msgpack_unpack_object obj;
- size_t count;
- unsigned int ct;
- msgpack_unpack_object map_key;
+ msgpack_unpack_object obj;
+ size_t count;
+ unsigned int ct;
+ msgpack_unpack_object map_key;
};
msgpack_unpack_struct_decl(_context) {
- msgpack_unpack_user user;
- unsigned int cs;
- unsigned int trail;
- unsigned int top;
- /*
- msgpack_unpack_struct(_stack)* stack;
- unsigned int stack_size;
- msgpack_unpack_struct(_stack) embed_stack[MSGPACK_EMBED_STACK_SIZE];
- */
- msgpack_unpack_struct(_stack) stack[MSGPACK_EMBED_STACK_SIZE];
+ msgpack_unpack_user user;
+ unsigned int cs;
+ unsigned int trail;
+ unsigned int top;
+ /*
+ msgpack_unpack_struct(_stack)* stack;
+ unsigned int stack_size;
+ msgpack_unpack_struct(_stack) embed_stack[MSGPACK_EMBED_STACK_SIZE];
+ */
+ msgpack_unpack_struct(_stack) stack[MSGPACK_EMBED_STACK_SIZE];
};
msgpack_unpack_func(void, _init)(msgpack_unpack_struct(_context)* ctx)
{
- ctx->cs = CS_HEADER;
- ctx->trail = 0;
- ctx->top = 0;
- /*
- ctx->stack = ctx->embed_stack;
- ctx->stack_size = MSGPACK_EMBED_STACK_SIZE;
- */
- ctx->stack[0].obj = msgpack_unpack_callback(_root)(&ctx->user);
+ ctx->cs = MSGPACK_CS_HEADER;
+ ctx->trail = 0;
+ ctx->top = 0;
+ /*
+ ctx->stack = ctx->embed_stack;
+ ctx->stack_size = MSGPACK_EMBED_STACK_SIZE;
+ */
+ ctx->stack[0].obj = msgpack_unpack_callback(_root)(&ctx->user);
}
/*
msgpack_unpack_func(void, _destroy)(msgpack_unpack_struct(_context)* ctx)
{
- if(ctx->stack_size != MSGPACK_EMBED_STACK_SIZE) {
- free(ctx->stack);
- }
+ if(ctx->stack_size != MSGPACK_EMBED_STACK_SIZE) {
+ free(ctx->stack);
+ }
}
*/
msgpack_unpack_func(msgpack_unpack_object, _data)(msgpack_unpack_struct(_context)* ctx)
{
- return (ctx)->stack[0].obj;
+ return (ctx)->stack[0].obj;
}
msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const char* data, size_t len, size_t* off)
{
- assert(len >= *off);
-
- const unsigned char* p = (unsigned char*)data + *off;
- const unsigned char* const pe = (unsigned char*)data + len;
- const void* n = NULL;
-
- unsigned int trail = ctx->trail;
- unsigned int cs = ctx->cs;
- unsigned int top = ctx->top;
- msgpack_unpack_struct(_stack)* stack = ctx->stack;
- /*
- unsigned int stack_size = ctx->stack_size;
- */
- msgpack_unpack_user* user = &ctx->user;
-
- msgpack_unpack_object obj;
- msgpack_unpack_struct(_stack)* c = NULL;
-
- int ret;
+ assert(len >= *off);
+ {
+ const unsigned char* p = (unsigned char*)data + *off;
+ const unsigned char* const pe = (unsigned char*)data + len;
+ const void* n = NULL;
+
+ unsigned int trail = ctx->trail;
+ unsigned int cs = ctx->cs;
+ unsigned int top = ctx->top;
+ msgpack_unpack_struct(_stack)* stack = ctx->stack;
+ /*
+ unsigned int stack_size = ctx->stack_size;
+ */
+ msgpack_unpack_user* user = &ctx->user;
+
+ msgpack_unpack_object obj;
+ msgpack_unpack_struct(_stack)* c = NULL;
+
+ int ret;
#define push_simple_value(func) \
- if(msgpack_unpack_callback(func)(user, &obj) < 0) { goto _failed; } \
- goto _push
+ if(msgpack_unpack_callback(func)(user, &obj) < 0) { goto _failed; } \
+ goto _push
#define push_fixed_value(func, arg) \
- if(msgpack_unpack_callback(func)(user, arg, &obj) < 0) { goto _failed; } \
- goto _push
+ if(msgpack_unpack_callback(func)(user, arg, &obj) < 0) { goto _failed; } \
+ goto _push
#define push_variable_value(func, base, pos, len) \
- if(msgpack_unpack_callback(func)(user, \
- (const char*)base, (const char*)pos, len, &obj) < 0) { goto _failed; } \
- goto _push
+ if(msgpack_unpack_callback(func)(user, \
+ (const char*)base, (const char*)pos, len, &obj) < 0) { goto _failed; } \
+ goto _push
#define again_fixed_trail(_cs, trail_len) \
- trail = trail_len; \
- cs = _cs; \
- goto _fixed_trail_again
+ trail = trail_len; \
+ cs = _cs; \
+ goto _fixed_trail_again
#define again_fixed_trail_if_zero(_cs, trail_len, ifzero) \
- trail = trail_len; \
- if(trail == 0) { goto ifzero; } \
- cs = _cs; \
- goto _fixed_trail_again
+ trail = trail_len; \
+ if(trail == 0) { goto ifzero; } \
+ cs = _cs; \
+ goto _fixed_trail_again
#define start_container(func, count_, ct_) \
- if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */ \
- if(msgpack_unpack_callback(func)(user, count_, &stack[top].obj) < 0) { goto _failed; } \
- if((count_) == 0) { obj = stack[top].obj; goto _push; } \
- stack[top].ct = ct_; \
- stack[top].count = count_; \
- ++top; \
- /*printf("container %d count %d stack %d\n",stack[top].obj,count_,top);*/ \
- /*printf("stack push %d\n", top);*/ \
- /* FIXME \
- if(top >= stack_size) { \
- if(stack_size == MSGPACK_EMBED_STACK_SIZE) { \
- size_t csize = sizeof(msgpack_unpack_struct(_stack)) * MSGPACK_EMBED_STACK_SIZE; \
- size_t nsize = csize * 2; \
- msgpack_unpack_struct(_stack)* tmp = (msgpack_unpack_struct(_stack)*)malloc(nsize); \
- if(tmp == NULL) { goto _failed; } \
- memcpy(tmp, ctx->stack, csize); \
- ctx->stack = stack = tmp; \
- ctx->stack_size = stack_size = MSGPACK_EMBED_STACK_SIZE * 2; \
- } else { \
- size_t nsize = sizeof(msgpack_unpack_struct(_stack)) * ctx->stack_size * 2; \
- msgpack_unpack_struct(_stack)* tmp = (msgpack_unpack_struct(_stack)*)realloc(ctx->stack, nsize); \
- if(tmp == NULL) { goto _failed; } \
- ctx->stack = stack = tmp; \
- ctx->stack_size = stack_size = stack_size * 2; \
- } \
- } \
- */ \
- goto _header_again
+ if(top >= MSGPACK_EMBED_STACK_SIZE) { goto _failed; } /* FIXME */ \
+ if(msgpack_unpack_callback(func)(user, count_, &stack[top].obj) < 0) { goto _failed; } \
+ if((count_) == 0) { obj = stack[top].obj; goto _push; } \
+ stack[top].ct = ct_; \
+ stack[top].count = count_; \
+ ++top; \
+ /*printf("container %d count %d stack %d\n",stack[top].obj,count_,top);*/ \
+ /*printf("stack push %d\n", top);*/ \
+ /* FIXME \
+ if(top >= stack_size) { \
+ if(stack_size == MSGPACK_EMBED_STACK_SIZE) { \
+ size_t csize = sizeof(msgpack_unpack_struct(_stack)) * MSGPACK_EMBED_STACK_SIZE; \
+ size_t nsize = csize * 2; \
+ msgpack_unpack_struct(_stack)* tmp = (msgpack_unpack_struct(_stack)*)malloc(nsize); \
+ if(tmp == NULL) { goto _failed; } \
+ memcpy(tmp, ctx->stack, csize); \
+ ctx->stack = stack = tmp; \
+ ctx->stack_size = stack_size = MSGPACK_EMBED_STACK_SIZE * 2; \
+ } else { \
+ size_t nsize = sizeof(msgpack_unpack_struct(_stack)) * ctx->stack_size * 2; \
+ msgpack_unpack_struct(_stack)* tmp = (msgpack_unpack_struct(_stack)*)realloc(ctx->stack, nsize); \
+ if(tmp == NULL) { goto _failed; } \
+ ctx->stack = stack = tmp; \
+ ctx->stack_size = stack_size = stack_size * 2; \
+ } \
+ } \
+ */ \
+ goto _header_again
#define NEXT_CS(p) \
- ((unsigned int)*p & 0x1f)
+ ((unsigned int)*p & 0x1f)
#ifdef USE_CASE_RANGE
#define SWITCH_RANGE_BEGIN switch(*p) {
@@ -182,220 +174,285 @@ msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const c
#define SWITCH_RANGE_END } }
#endif
- if(p == pe) { goto _out; }
- do {
- switch(cs) {
- case CS_HEADER:
- SWITCH_RANGE_BEGIN
- SWITCH_RANGE(0x00, 0x7f) // Positive Fixnum
- push_fixed_value(_uint8, *(uint8_t*)p);
- SWITCH_RANGE(0xe0, 0xff) // Negative Fixnum
- push_fixed_value(_int8, *(int8_t*)p);
- SWITCH_RANGE(0xc0, 0xdf) // Variable
- switch(*p) {
- case 0xc0: // nil
- push_simple_value(_nil);
- //case 0xc1: // string
- // again_terminal_trail(NEXT_CS(p), p+1);
- case 0xc2: // false
- push_simple_value(_false);
- case 0xc3: // true
- push_simple_value(_true);
- //case 0xc4:
- //case 0xc5:
- //case 0xc6:
- //case 0xc7:
- //case 0xc8:
- //case 0xc9:
- case 0xca: // float
- case 0xcb: // double
- case 0xcc: // unsigned int 8
- case 0xcd: // unsigned int 16
- case 0xce: // unsigned int 32
- case 0xcf: // unsigned int 64
- case 0xd0: // signed int 8
- case 0xd1: // signed int 16
- case 0xd2: // signed int 32
- case 0xd3: // signed int 64
- again_fixed_trail(NEXT_CS(p), 1 << (((unsigned int)*p) & 0x03));
- //case 0xd4:
- //case 0xd5:
- //case 0xd6: // big integer 16
- //case 0xd7: // big integer 32
- //case 0xd8: // big float 16
- //case 0xd9: // big float 32
- case 0xda: // raw 16
- case 0xdb: // raw 32
- case 0xdc: // array 16
- case 0xdd: // array 32
- case 0xde: // map 16
- case 0xdf: // map 32
- again_fixed_trail(NEXT_CS(p), 2 << (((unsigned int)*p) & 0x01));
- default:
- goto _failed;
- }
- SWITCH_RANGE(0xa0, 0xbf) // FixRaw
- again_fixed_trail_if_zero(ACS_RAW_VALUE, ((unsigned int)*p & 0x1f), _raw_zero);
- SWITCH_RANGE(0x90, 0x9f) // FixArray
- start_container(_array, ((unsigned int)*p) & 0x0f, CT_ARRAY_ITEM);
- SWITCH_RANGE(0x80, 0x8f) // FixMap
- start_container(_map, ((unsigned int)*p) & 0x0f, CT_MAP_KEY);
-
- SWITCH_RANGE_DEFAULT
- goto _failed;
- SWITCH_RANGE_END
- // end CS_HEADER
-
-
- _fixed_trail_again:
- ++p;
-
- default:
- if((size_t)(pe - p) < trail) { goto _out; }
- n = p; p += trail - 1;
- switch(cs) {
- //case CS_
- //case CS_
- case CS_FLOAT: {
- union { uint32_t i; float f; } mem;
- mem.i = _msgpack_load32(uint32_t,n);
- push_fixed_value(_float, mem.f); }
- case CS_DOUBLE: {
- union { uint64_t i; double f; } mem;
- mem.i = _msgpack_load64(uint64_t,n);
-#if defined(__arm__) && !(__ARM_EABI__) // arm-oabi
- // https://github.com/msgpack/msgpack-perl/pull/1
- mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
+ if(p == pe) { goto _out; }
+ do {
+ switch(cs) {
+ case MSGPACK_CS_HEADER:
+ SWITCH_RANGE_BEGIN
+ SWITCH_RANGE(0x00, 0x7f) // Positive Fixnum
+ push_fixed_value(_uint8, *(uint8_t*)p);
+ SWITCH_RANGE(0xe0, 0xff) // Negative Fixnum
+ push_fixed_value(_int8, *(int8_t*)p);
+ SWITCH_RANGE(0xc0, 0xdf) // Variable
+ switch(*p) {
+ case 0xc0: // nil
+ push_simple_value(_nil);
+ //case 0xc1: // string
+ // again_terminal_trail(NEXT_CS(p), p+1);
+ case 0xc2: // false
+ push_simple_value(_false);
+ case 0xc3: // true
+ push_simple_value(_true);
+ case 0xc4: // bin 8
+ case 0xc5: // bin 16
+ case 0xc6: // bin 32
+ again_fixed_trail(NEXT_CS(p), 1 << (((unsigned int)*p) & 0x03));
+ case 0xc7: // ext 8
+ case 0xc8: // ext 16
+ case 0xc9: // ext 32
+ again_fixed_trail(NEXT_CS(p), 1 << ((((unsigned int)*p) + 1) & 0x03));
+ case 0xca: // float
+ case 0xcb: // double
+ case 0xcc: // unsigned int 8
+ case 0xcd: // unsigned int 16
+ case 0xce: // unsigned int 32
+ case 0xcf: // unsigned int 64
+ case 0xd0: // signed int 8
+ case 0xd1: // signed int 16
+ case 0xd2: // signed int 32
+ case 0xd3: // signed int 64
+ again_fixed_trail(NEXT_CS(p), 1 << (((unsigned int)*p) & 0x03));
+ case 0xd4: // fixext 1
+ case 0xd5: // fixext 2
+ case 0xd6: // fixext 4
+ case 0xd7: // fixext 8
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE,
+ (1 << (((unsigned int)*p) & 0x03)) + 1, _ext_zero);
+ case 0xd8: // fixext 16
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 16+1, _ext_zero);
+
+ case 0xd9: // str 8
+ case 0xda: // str 16
+ case 0xdb: // str 32
+ again_fixed_trail(NEXT_CS(p), 1 << ((((unsigned int)*p) & 0x03) - 1));
+ case 0xdc: // array 16
+ case 0xdd: // array 32
+ case 0xde: // map 16
+ case 0xdf: // map 32
+ again_fixed_trail(NEXT_CS(p), 2u << (((unsigned int)*p) & 0x01));
+ default:
+ goto _failed;
+ }
+ SWITCH_RANGE(0xa0, 0xbf) // FixStr
+ again_fixed_trail_if_zero(MSGPACK_ACS_STR_VALUE, ((unsigned int)*p & 0x1f), _str_zero);
+ SWITCH_RANGE(0x90, 0x9f) // FixArray
+ start_container(_array, ((unsigned int)*p) & 0x0f, MSGPACK_CT_ARRAY_ITEM);
+ SWITCH_RANGE(0x80, 0x8f) // FixMap
+ start_container(_map, ((unsigned int)*p) & 0x0f, MSGPACK_CT_MAP_KEY);
+
+ SWITCH_RANGE_DEFAULT
+ goto _failed;
+ SWITCH_RANGE_END
+ // end MSGPACK_CS_HEADER
+
+
+ _fixed_trail_again:
+ ++p;
+
+ default:
+ if((size_t)(pe - p) < trail) { goto _out; }
+ n = p; p += trail - 1;
+ switch(cs) {
+ //case MSGPACK_CS_
+ //case MSGPACK_CS_
+ case MSGPACK_CS_FLOAT: {
+ union { uint32_t i; float f; } mem;
+ _msgpack_load32(uint32_t, n, &mem.i);
+ push_fixed_value(_float, mem.f); }
+ case MSGPACK_CS_DOUBLE: {
+ union { uint64_t i; double f; } mem;
+ _msgpack_load64(uint64_t, n, &mem.i);
+#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
- push_fixed_value(_double, mem.f); }
- case CS_UINT_8:
- push_fixed_value(_uint8, *(uint8_t*)n);
- case CS_UINT_16:
- push_fixed_value(_uint16, _msgpack_load16(uint16_t,n));
- case CS_UINT_32:
- push_fixed_value(_uint32, _msgpack_load32(uint32_t,n));
- case CS_UINT_64:
- push_fixed_value(_uint64, _msgpack_load64(uint64_t,n));
-
- case CS_INT_8:
- push_fixed_value(_int8, *(int8_t*)n);
- case CS_INT_16:
- push_fixed_value(_int16, _msgpack_load16(int16_t,n));
- case CS_INT_32:
- push_fixed_value(_int32, _msgpack_load32(int32_t,n));
- case CS_INT_64:
- push_fixed_value(_int64, _msgpack_load64(int64_t,n));
-
- //case CS_
- //case CS_
- //case CS_BIG_INT_16:
- // again_fixed_trail_if_zero(ACS_BIG_INT_VALUE, _msgpack_load16(uint16_t,n), _big_int_zero);
- //case CS_BIG_INT_32:
- // again_fixed_trail_if_zero(ACS_BIG_INT_VALUE, _msgpack_load32(uint32_t,n), _big_int_zero);
- //case ACS_BIG_INT_VALUE:
- //_big_int_zero:
- // // FIXME
- // push_variable_value(_big_int, data, n, trail);
-
- //case CS_BIG_FLOAT_16:
- // again_fixed_trail_if_zero(ACS_BIG_FLOAT_VALUE, _msgpack_load16(uint16_t,n), _big_float_zero);
- //case CS_BIG_FLOAT_32:
- // again_fixed_trail_if_zero(ACS_BIG_FLOAT_VALUE, _msgpack_load32(uint32_t,n), _big_float_zero);
- //case ACS_BIG_FLOAT_VALUE:
- //_big_float_zero:
- // // FIXME
- // push_variable_value(_big_float, data, n, trail);
-
- case CS_RAW_16:
- again_fixed_trail_if_zero(ACS_RAW_VALUE, _msgpack_load16(uint16_t,n), _raw_zero);
- case CS_RAW_32:
- again_fixed_trail_if_zero(ACS_RAW_VALUE, _msgpack_load32(uint32_t,n), _raw_zero);
- case ACS_RAW_VALUE:
- _raw_zero:
- push_variable_value(_raw, data, n, trail);
-
- case CS_ARRAY_16:
- start_container(_array, _msgpack_load16(uint16_t,n), CT_ARRAY_ITEM);
- case CS_ARRAY_32:
- /* FIXME security guard */
- start_container(_array, _msgpack_load32(uint32_t,n), CT_ARRAY_ITEM);
-
- case CS_MAP_16:
- start_container(_map, _msgpack_load16(uint16_t,n), CT_MAP_KEY);
- case CS_MAP_32:
- /* FIXME security guard */
- start_container(_map, _msgpack_load32(uint32_t,n), CT_MAP_KEY);
-
- default:
- goto _failed;
- }
- }
-
-_push:
- if(top == 0) { goto _finish; }
- c = &stack[top-1];
- switch(c->ct) {
- case CT_ARRAY_ITEM:
- if(msgpack_unpack_callback(_array_item)(user, &c->obj, obj) < 0) { goto _failed; }
- if(--c->count == 0) {
- obj = c->obj;
- --top;
- /*printf("stack pop %d\n", top);*/
- goto _push;
- }
- goto _header_again;
- case CT_MAP_KEY:
- c->map_key = obj;
- c->ct = CT_MAP_VALUE;
- goto _header_again;
- case CT_MAP_VALUE:
- if(msgpack_unpack_callback(_map_item)(user, &c->obj, c->map_key, obj) < 0) { goto _failed; }
- if(--c->count == 0) {
- obj = c->obj;
- --top;
- /*printf("stack pop %d\n", top);*/
- goto _push;
- }
- c->ct = CT_MAP_KEY;
- goto _header_again;
-
- default:
- goto _failed;
- }
-
-_header_again:
- cs = CS_HEADER;
- ++p;
- } while(p != pe);
- goto _out;
-
-
-_finish:
- stack[0].obj = obj;
- ++p;
- ret = 1;
- /*printf("-- finish --\n"); */
- goto _end;
-
-_failed:
- /*printf("** FAILED **\n"); */
- ret = -1;
- goto _end;
-
-_out:
- ret = 0;
- goto _end;
-
-_end:
- ctx->cs = cs;
- ctx->trail = trail;
- ctx->top = top;
- *off = p - (const unsigned char*)data;
-
- return ret;
+ push_fixed_value(_double, mem.f); }
+ case MSGPACK_CS_UINT_8:
+ push_fixed_value(_uint8, *(uint8_t*)n);
+ case MSGPACK_CS_UINT_16:{
+ uint16_t tmp;
+ _msgpack_load16(uint16_t,n,&tmp);
+ push_fixed_value(_uint16, tmp);
+ }
+ case MSGPACK_CS_UINT_32:{
+ uint32_t tmp;
+ _msgpack_load32(uint32_t,n,&tmp);
+ push_fixed_value(_uint32, tmp);
+ }
+ case MSGPACK_CS_UINT_64:{
+ uint64_t tmp;
+ _msgpack_load64(uint64_t,n,&tmp);
+ push_fixed_value(_uint64, tmp);
+ }
+ case MSGPACK_CS_INT_8:
+ push_fixed_value(_int8, *(int8_t*)n);
+ case MSGPACK_CS_INT_16:{
+ int16_t tmp;
+ _msgpack_load16(int16_t,n,&tmp);
+ push_fixed_value(_int16, tmp);
+ }
+ case MSGPACK_CS_INT_32:{
+ int32_t tmp;
+ _msgpack_load32(int32_t,n,&tmp);
+ push_fixed_value(_int32, tmp);
+ }
+ case MSGPACK_CS_INT_64:{
+ int64_t tmp;
+ _msgpack_load64(int64_t,n,&tmp);
+ push_fixed_value(_int64, tmp);
+ }
+ case MSGPACK_CS_FIXEXT_1:
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 1+1, _ext_zero);
+ case MSGPACK_CS_FIXEXT_2:
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 2+1, _ext_zero);
+ case MSGPACK_CS_FIXEXT_4:
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 4+1, _ext_zero);
+ case MSGPACK_CS_FIXEXT_8:
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 8+1, _ext_zero);
+ case MSGPACK_CS_FIXEXT_16:
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, 16+1, _ext_zero);
+ case MSGPACK_CS_STR_8:
+ again_fixed_trail_if_zero(MSGPACK_ACS_STR_VALUE, *(uint8_t*)n, _str_zero);
+ case MSGPACK_CS_BIN_8:
+ again_fixed_trail_if_zero(MSGPACK_ACS_BIN_VALUE, *(uint8_t*)n, _bin_zero);
+ case MSGPACK_CS_EXT_8:
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, (*(uint8_t*)n) + 1, _ext_zero);
+ case MSGPACK_CS_STR_16:{
+ uint16_t tmp;
+ _msgpack_load16(uint16_t,n,&tmp);
+ again_fixed_trail_if_zero(MSGPACK_ACS_STR_VALUE, tmp, _str_zero);
+ }
+ case MSGPACK_CS_BIN_16:{
+ uint16_t tmp;
+ _msgpack_load16(uint16_t,n,&tmp);
+ again_fixed_trail_if_zero(MSGPACK_ACS_BIN_VALUE, tmp, _bin_zero);
+ }
+ case MSGPACK_CS_EXT_16:{
+ uint16_t tmp;
+ _msgpack_load16(uint16_t,n,&tmp);
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, tmp + 1, _ext_zero);
+ }
+ case MSGPACK_CS_STR_32:{
+ uint32_t tmp;
+ _msgpack_load32(uint32_t,n,&tmp);
+ again_fixed_trail_if_zero(MSGPACK_ACS_STR_VALUE, tmp, _str_zero);
+ }
+ case MSGPACK_CS_BIN_32:{
+ uint32_t tmp;
+ _msgpack_load32(uint32_t,n,&tmp);
+ again_fixed_trail_if_zero(MSGPACK_ACS_BIN_VALUE, tmp, _bin_zero);
+ }
+ case MSGPACK_CS_EXT_32:{
+ uint32_t tmp;
+ _msgpack_load32(uint32_t,n,&tmp);
+ again_fixed_trail_if_zero(MSGPACK_ACS_EXT_VALUE, tmp + 1, _ext_zero);
+ }
+ case MSGPACK_ACS_STR_VALUE:
+ _str_zero:
+ push_variable_value(_str, data, n, trail);
+ case MSGPACK_ACS_BIN_VALUE:
+ _bin_zero:
+ push_variable_value(_bin, data, n, trail);
+ case MSGPACK_ACS_EXT_VALUE:
+ _ext_zero:
+ push_variable_value(_ext, data, n, trail);
+
+ case MSGPACK_CS_ARRAY_16:{
+ uint16_t tmp;
+ _msgpack_load16(uint16_t,n,&tmp);
+ start_container(_array, tmp, MSGPACK_CT_ARRAY_ITEM);
+ }
+ case MSGPACK_CS_ARRAY_32:{
+ /* FIXME security guard */
+ uint32_t tmp;
+ _msgpack_load32(uint32_t,n,&tmp);
+ start_container(_array, tmp, MSGPACK_CT_ARRAY_ITEM);
+ }
+
+ case MSGPACK_CS_MAP_16:{
+ uint16_t tmp;
+ _msgpack_load16(uint16_t,n,&tmp);
+ start_container(_map, tmp, MSGPACK_CT_MAP_KEY);
+ }
+ case MSGPACK_CS_MAP_32:{
+ /* FIXME security guard */
+ uint32_t tmp;
+ _msgpack_load32(uint32_t,n,&tmp);
+ start_container(_map, tmp, MSGPACK_CT_MAP_KEY);
+ }
+
+ default:
+ goto _failed;
+ }
+ }
+
+ _push:
+ if(top == 0) { goto _finish; }
+ c = &stack[top-1];
+ switch(c->ct) {
+ case MSGPACK_CT_ARRAY_ITEM:
+ if(msgpack_unpack_callback(_array_item)(user, &c->obj, obj) < 0) { goto _failed; }
+ if(--c->count == 0) {
+ obj = c->obj;
+ --top;
+ /*printf("stack pop %d\n", top);*/
+ goto _push;
+ }
+ goto _header_again;
+ case MSGPACK_CT_MAP_KEY:
+ c->map_key = obj;
+ c->ct = MSGPACK_CT_MAP_VALUE;
+ goto _header_again;
+ case MSGPACK_CT_MAP_VALUE:
+ if(msgpack_unpack_callback(_map_item)(user, &c->obj, c->map_key, obj) < 0) { goto _failed; }
+ if(--c->count == 0) {
+ obj = c->obj;
+ --top;
+ /*printf("stack pop %d\n", top);*/
+ goto _push;
+ }
+ c->ct = MSGPACK_CT_MAP_KEY;
+ goto _header_again;
+
+ default:
+ goto _failed;
+ }
+
+ _header_again:
+ cs = MSGPACK_CS_HEADER;
+ ++p;
+ } while(p != pe);
+ goto _out;
+
+
+ _finish:
+ stack[0].obj = obj;
+ ++p;
+ ret = 1;
+ /*printf("-- finish --\n"); */
+ goto _end;
+
+ _failed:
+ /*printf("** FAILED **\n"); */
+ ret = -1;
+ goto _end;
+
+ _out:
+ ret = 0;
+ goto _end;
+
+ _end:
+ ctx->cs = cs;
+ ctx->trail = trail;
+ ctx->top = top;
+ *off = (size_t)(p - (const unsigned char*)data);
+
+ return ret;
+ }
}
-
#undef msgpack_unpack_func
#undef msgpack_unpack_callback
#undef msgpack_unpack_struct
@@ -411,3 +468,7 @@ _end:
#undef NEXT_CS
+#undef SWITCH_RANGE_BEGIN
+#undef SWITCH_RANGE
+#undef SWITCH_RANGE_DEFAULT
+#undef SWITCH_RANGE_END
diff --git a/lib/Data/MessagePack.pm b/lib/Data/MessagePack.pm
index 28dad7c..9eb6f62 100644
--- a/lib/Data/MessagePack.pm
+++ b/lib/Data/MessagePack.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use 5.008001;
-our $VERSION = '0.48';
+our $VERSION = '1.00';
sub true () {
require Data::MessagePack::Boolean;
@@ -274,7 +274,7 @@ hanekomu
Kazuho Oku
-shohex
+syohex
=head1 LICENSE
diff --git a/lib/Data/MessagePack/Boolean.pm b/lib/Data/MessagePack/Boolean.pm
index 2bb3eca..4859be1 100644
--- a/lib/Data/MessagePack/Boolean.pm
+++ b/lib/Data/MessagePack/Boolean.pm
@@ -1,5 +1,6 @@
package Data::MessagePack::Boolean;
use strict;
+use warnings;
use overload
'bool' => sub { ${ $_[0] } },
'0+' => sub { ${ $_[0] } },
diff --git a/lib/Data/MessagePack/PP.pm b/lib/Data/MessagePack/PP.pm
index 26e5729..5d85c31 100644
--- a/lib/Data/MessagePack/PP.pm
+++ b/lib/Data/MessagePack/PP.pm
@@ -231,7 +231,7 @@ sub _pack {
my $b_obj = B::svref_2object( \$value );
my $flags = $b_obj->FLAGS;
- if ( $flags & B::SVp_POK ) { # raw / check needs before dboule
+ if ( $flags & B::SVp_POK ) { # raw / check needs before double
if ( $self->{prefer_integer} ) {
if ( $value =~ /^-?[0-9]+$/ ) { # ok?
@@ -252,12 +252,21 @@ sub _pack {
utf8::encode( $value ) if utf8::is_utf8( $value );
my $num = length $value;
- my $header =
- $num < 32 ? CORE::pack( 'C', 0xa0 + $num )
- : $num < 2 ** 16 - 1 ? CORE::pack( 'Cn', 0xda, $num )
- : $num < 2 ** 32 - 1 ? CORE::pack( 'CN', 0xdb, $num )
- : _unexpected('number %d', $num)
- ;
+ my $header;
+ if ($self->{utf8}) { # Str
+ $header =
+ $num < 32 ? CORE::pack( 'C', 0xa0 + $num )
+ : $num < 2 ** 8 - 1 ? CORE::pack( 'CC', 0xd9, $num)
+ : $num < 2 ** 16 - 1 ? CORE::pack( 'Cn', 0xda, $num )
+ : $num < 2 ** 32 - 1 ? CORE::pack( 'CN', 0xdb, $num )
+ : _unexpected('number %d', $num);
+ } else { # Bin
+ $header =
+ $num < 2 ** 8 - 1 ? CORE::pack( 'CC', 0xc4, $num)
+ : $num < 2 ** 16 - 1 ? CORE::pack( 'Cn', 0xc5, $num )
+ : $num < 2 ** 32 - 1 ? CORE::pack( 'CN', 0xc6, $num )
+ : _unexpected('number %d', $num);
+ }
return $header . $value;
@@ -308,10 +317,11 @@ sub unpack :method {
return $data;
}
-my $T_RAW = 0x01;
+my $T_STR = 0x01;
my $T_ARRAY = 0x02;
my $T_MAP = 0x04;
-my $T_DIRECT = 0x08; # direct mapping (e.g. 0xc0 <-> nil)
+my $T_BIN = 0x08;
+my $T_DIRECT = 0x10; # direct mapping (e.g. 0xc0 <-> nil)
my @typemap = ( (0x00) x 256 );
@@ -325,10 +335,16 @@ $typemap[$_] |= $T_MAP for
0xde, # map16
0xdf, # map32
;
-$typemap[$_] |= $T_RAW for
- 0xa0 .. 0xbf, # fix raw
- 0xda, # raw16
- 0xdb, # raw32
+$typemap[$_] |= $T_STR for
+ 0xa0 .. 0xbf, # fix str
+ 0xd9, # str8
+ 0xda, # str16
+ 0xdb, # str32
+;
+$typemap[$_] |= $T_BIN for
+ 0xc4, # bin 8
+ 0xc5, # bin 16
+ 0xc6, # bin 32
;
my @byte2value;
@@ -345,8 +361,13 @@ foreach my $pair(
}
sub _fetch_size {
- my($value_ref, $byte, $x16, $x32, $x_fixbits) = @_;
- if ( $byte == $x16 ) {
+ my($value_ref, $byte, $x8, $x16, $x32, $x_fixbits) = @_;
+ if ( defined($x8) && $byte == $x8 ) {
+ $p += 1;
+ $p <= length(${$value_ref}) or _insufficient('x/8');
+ return unpack 'C', substr( ${$value_ref}, $p - 1, 1);
+ }
+ elsif ( $byte == $x16 ) {
$p += 2;
$p <= length(${$value_ref}) or _insufficient('x/16');
return unpack 'n', substr( ${$value_ref}, $p - 2, 2 );
@@ -371,22 +392,22 @@ sub _unpack {
# +/- fixnum, nil, true, false
return $byte2value[$byte] if $typemap[$byte] & $T_DIRECT;
- if ( $typemap[$byte] & $T_RAW ) {
- my $size = _fetch_size(\$value, $byte, 0xda, 0xdb, 0xa0);
+ if ( $typemap[$byte] & $T_STR ) {
+ my $size = _fetch_size(\$value, $byte, 0xd9, 0xda, 0xdb, 0xa0);
my $s = substr( $value, $p, $size );
length($s) == $size or _insufficient('raw');
$p += $size;
- utf8::decode($s) if $_utf8;
+ utf8::decode($s);
return $s;
}
elsif ( $typemap[$byte] & $T_ARRAY ) {
- my $size = _fetch_size(\$value, $byte, 0xdc, 0xdd, 0x90);
+ my $size = _fetch_size(\$value, $byte, undef, 0xdc, 0xdd, 0x90);
my @array;
push @array, _unpack( $value ) while --$size >= 0;
return \@array;
}
elsif ( $typemap[$byte] & $T_MAP ) {
- my $size = _fetch_size(\$value, $byte, 0xde, 0xdf, 0x80);
+ my $size = _fetch_size(\$value, $byte, undef, 0xde, 0xdf, 0x80);
my %map;
while(--$size >= 0) {
no warnings; # for undef key case
@@ -396,7 +417,14 @@ sub _unpack {
}
return \%map;
}
-
+ elsif ($typemap[$byte] & $T_BIN) {
+ my $size = _fetch_size(\$value, $byte, 0xc4, 0xc5, 0xc6, 0x80);
+ my $s = substr( $value, $p, $size );
+ length($s) == $size or _insufficient('bin');
+ $p += $size;
+ utf8::decode($s) if $_utf8;
+ return $s;
+ }
elsif ( $byte == 0xcc ) { # uint8
$p++;
$p <= length($value) or _insufficient('uint8');
@@ -525,9 +553,13 @@ sub _count {
# +/- fixnum, nil, true, false
return 1 if $typemap[$byte] & $T_DIRECT;
- if ( $typemap[$byte] & $T_RAW ) {
+ if ( $typemap[$byte] & $T_STR ) {
my $num;
- if ( $byte == 0xda ) {
+ if ( $byte == 0xd9 ) {
+ $num = unpack 'C', substr( $value, $p, 1 );
+ $p += 1;
+ }
+ elsif ( $byte == 0xda ) {
$num = unpack 'n', substr( $value, $p, 2 );
$p += 2;
}
@@ -581,7 +613,24 @@ sub _count {
return 1;
}
+ elsif ( $typemap[$byte] & $T_BIN ) {
+ my $num;
+ if ( $byte == 0xc4 ) { # bin 8
+ $num = unpack 'C', substr( $value, $p, 1 );
+ $p += 1;
+ }
+ elsif ( $byte == 0xc5 ) { # bin 16
+ $num = unpack 'n', substr( $value, $p, 2 );
+ $p += 2;
+ }
+ elsif ( $byte == 0xc6 ) { # bin 32
+ $num = unpack 'N', substr( $value, $p, 4 );
+ $p += 4;
+ }
+ $p += $num;
+ return 1;
+ }
elsif ( $byte >= 0xcc and $byte <= 0xcf ) { # uint
$p += $byte == 0xcc ? 1
: $byte == 0xcd ? 2
diff --git a/t/01_pack.t b/t/01_pack.t
index 33e8243..99f0ca0 100644
--- a/t/01_pack.t
+++ b/t/01_pack.t
@@ -12,14 +12,25 @@ sub packit {
$_;
}
+sub packit_utf8 {
+ local $_ = unpack("H*", Data::MessagePack->new->utf8->pack($_[0]));
+ s/(..)/$1 /g;
+ s/ $//;
+ $_;
+}
+
sub pis ($$) {
is packit($_[0]), $_[1], 'dump ' . $_[1];
}
+sub pis_utf8 ($$) {
+ is packit_utf8($_[0]), $_[1], 'dump ' . $_[1];
+}
+
my @dat = (
0, '00',
(my $foo="0")+0, '00',
- {2 => undef}, '81 a1 32 c0',
+ {2 => undef}, '81 c4 01 32 c0',
do {no warnings; my $foo = 10; "$foo"; $foo = undef; $foo} => 'c0', # PVIV but !POK && !IOK
1, '01',
127, '7f',
@@ -36,35 +47,53 @@ my @dat = (
-32768, 'd1 80 00',
-32769, 'd2 ff ff 7f ff',
1.0, 'cb 3f f0 00 00 00 00 00 00',
- $] < 5.019 ? do { my $x=3.0;my $y = "$x";$x } : Scalar::Util::dualvar(3.0,"3"), 'a1 33', # PVNV
- do { my $x=3; my $y = "$x";$x }, 'a1 33', # PVIV
- "", 'a0',
- "a", 'a1 61',
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'bf 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61',
- "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'da 00 20 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61',
+ $] < 5.019 ? do { my $x=3.0;my $y = "$x";$x } : Scalar::Util::dualvar(3.0,"3"), 'c4 01 33', # PVNV
+ do { my $x=3; my $y = "$x";$x }, 'c4 01 33', # PVIV
+ "", 'c4 00',
+ "a", 'c4 01 61',
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'c4 1f 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61',
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'c4 20 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61',
undef, 'c0',
Data::MessagePack::true(), 'c3',
Data::MessagePack::false(), 'c2',
[], '90',
[+[]], '91 90',
[[], undef], '92 90 c0',
- {'a', 0}, '81 a1 61 00',
+ {'a', 0}, '81 c4 01 61 00',
8388608, 'ce 00 80 00 00',
[undef, false, true], '93 c0 c2 c3',
- ["", "a", "bc", "def"], '94 a0 a1 61 a2 62 63 a3 64 65 66',
+ ["", "a", "bc", "def"], '94 c4 00 c4 01 61 c4 02 62 63 c4 03 64 65 66',
[[], [[undef]]], '92 90 91 91 c0',
[undef, false, true], '93 c0 c2 c3',
[[0, 64, 127], [-32, -16, -1]], '92 93 00 40 7f 93 e0 f0 ff',
[0, -128, -1, 0, -32768, -1, 0, -2147483648, -1], '99 00 d0 80 ff 00 d1 80 00 ff 00 d2 80 00 00 00 ff',
2147483648, 'ce 80 00 00 00',
-2147483648, 'd2 80 00 00 00',
- 'a' x 0x0100, 'da 01 00' . (' 61' x 0x0100),
+ 'a' x 0x0100, 'c5 01 00' . (' 61' x 0x0100),
[(undef) x 0x0100], 'dc 01 00' . (' c0' x 0x0100),
);
-plan tests => 1*(scalar(@dat)/2);
+
+my @dat_utf8 = (
+ {2 => undef}, '81 a1 32 c0',
+ $] < 5.019 ? do { my $x=3.0;my $y = "$x";$x } : Scalar::Util::dualvar(3.0,"3"), 'a1 33', # PVNV
+ do { my $x=3; my $y = "$x";$x }, 'a1 33', # PVIV
+ "", 'a0',
+ "a", 'a1 61',
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'bf 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61',
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'd9 20 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61',
+ {'a', 0}, '81 a1 61 00',
+
+ ["", "a", "bc", "def"], '94 a0 a1 61 a2 62 63 a3 64 65 66',
+ 'a' x 0x0100, 'da 01 00' . (' 61' x 0x0100),
+);
+
+plan tests => 1*(scalar(@dat)/2) + 1*(scalar(@dat_utf8)/2);
for (my $i=0; $i<scalar(@dat); ) {
pis $dat[$i++], $dat[$i++];
}
+for (my $i=0; $i<scalar(@dat_utf8); ) {
+ pis_utf8 $dat_utf8[$i++], $dat_utf8[$i++];
+}
diff --git a/t/05_preferred_int.t b/t/05_preferred_int.t
index 084df31..c1db9f3 100644
--- a/t/05_preferred_int.t
+++ b/t/05_preferred_int.t
@@ -11,6 +11,13 @@ sub packit {
$_;
}
+sub packit_utf8 {
+ local $_ = unpack("H*", Data::MessagePack->new->utf8->prefer_integer($_[1])->pack($_[0]));
+ s/(..)/$1 /g;
+ s/ $//;
+ $_;
+}
+
sub pis ($$) {
if (ref $_[1]) {
like packit($_[0]), $_[1], 'dump ' . $_[1];
@@ -20,34 +27,58 @@ sub pis ($$) {
# is(Dumper(Data::MessagePack->unpack(Data::MessagePack->pack($_[0]))), Dumper($_[0]));
}
+sub pis_utf8 ($$$) {
+ if (ref $_[1]) {
+ like packit_utf8($_[0], $_[2]), $_[1], 'dump ' . $_[1];
+ } else {
+ is packit_utf8($_[0], $_[2]), $_[1], 'dump ' . $_[1];
+ }
+ # is(Dumper(Data::MessagePack->unpack(Data::MessagePack->pack($_[0]))), Dumper($_[0]));
+}
+
my $is_win = $^O eq 'MSWin32';
my @dat = (
- '', 'a0',
+ '', 'c4 00',
'0', '00',
'1', '01',
'10', '0a',
'-1', 'ff',
'-10', 'f6',
- '-', 'a1 2d',
+ '-', 'c4 01 2d',
''.0xEFFF => 'cd ef ff',
''.0xFFFF => 'cd ff ff',
''.0xFFFFFF => 'ce 00 ff ff ff',
''.0xFFFFFFFF => 'ce ff ff ff ff',
+ ''.0xFFFFFFFFF => 'c4 0b 36 38 37 31 39 34 37 36 37 33 35',
+ ''.0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFF => $is_win ?
+ qr{^(c4 15 38 2e 33 30 37 36 37 34 39 37 33 36 35 35 37 32 65 2b 30 33 34|c4 18 38 2e 33 30 37 36 37 34 39 37 33 36 35 35 37 32 34 32 31 65 2b 30 33 34)$}
+ : qr{^(c4 14 38 2e 33 30 37 36 37 34 39 37 33 36 35 35 37 32 65 2b 33 34|c4 17 38 2e 33 30 37 36 37 34 39 37 33 36 35 35 37 32 34 32 31 65 2b 33 34)$},
+ '-'.0x8000000 => 'd2 f8 00 00 00',
+ '-'.0x80000000 => 'd2 80 00 00 00',
+ '-'.0x800000000 => 'c4 0c 2d 33 34 33 35 39 37 33 38 33 36 38',
+ '-'.0x8000000000 => 'c4 0d 2d 35 34 39 37 35 35 38 31 33 38 38 38',
+ '-'.0x800000000000000000000000000000 => $is_win ?
+ qr{^(c4 16 2d 36 2e 36 34 36 31 33 39 39 37 38 39 32 34 35 38 65 2b 30 33 35|c4 19 2d 36 2e 36 34 36 31 33 39 39 37 38 39 32 34 35 37 39 33 36 65 2b 30 33 35)}
+ : qr{^(c4 15 2d 36 2e 36 34 36 31 33 39 39 37 38 39 32 34 35 38 65 2b 33 35|c4 18 2d 36 2e 36 34 36 31 33 39 39 37 38 39 32 34 35 37 39 33 36 65 2b 33 35)},
+ {'0' => '1'}, '81 00 01',
+ {'abc' => '1'}, '81 c4 03 61 62 63 01',
+);
+
+my @dat_utf8 = (
+ '-', 'a1 2d',
''.0xFFFFFFFFF => 'ab 36 38 37 31 39 34 37 36 37 33 35',
- ''.0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFF => $is_win ?
+ ''.0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFF => $is_win ?
qr{^(b5 38 2e 33 30 37 36 37 34 39 37 33 36 35 35 37 32 65 2b 30 33 34|b8 38 2e 33 30 37 36 37 34 39 37 33 36 35 35 37 32 34 32 31 65 2b 30 33 34)$}
: qr{^(b4 38 2e 33 30 37 36 37 34 39 37 33 36 35 35 37 32 65 2b 33 34|b7 38 2e 33 30 37 36 37 34 39 37 33 36 35 35 37 32 34 32 31 65 2b 33 34)$},
- '-'.0x8000000 => 'd2 f8 00 00 00',
- '-'.0x80000000 => 'd2 80 00 00 00',
'-'.0x800000000 => 'ac 2d 33 34 33 35 39 37 33 38 33 36 38',
'-'.0x8000000000 => 'ad 2d 35 34 39 37 35 35 38 31 33 38 38 38',
- '-'.0x800000000000000000000000000000 => $is_win ?
+ '-'.0x800000000000000000000000000000 => $is_win ?
qr{^(b6 2d 36 2e 36 34 36 31 33 39 39 37 38 39 32 34 35 38 65 2b 30 33 35|b9 2d 36 2e 36 34 36 31 33 39 39 37 38 39 32 34 35 37 39 33 36 65 2b 30 33 35)}
: qr{^(b5 2d 36 2e 36 34 36 31 33 39 39 37 38 39 32 34 35 38 65 2b 33 35|b8 2d 36 2e 36 34 36 31 33 39 39 37 38 39 32 34 35 37 39 33 36 65 2b 33 35)},
- {'0' => '1'}, '81 00 01',
{'abc' => '1'}, '81 a3 61 62 63 01',
);
-plan tests => 1*(scalar(@dat)/2) + 2;
+
+plan tests => 1*(scalar(@dat)/2) + 1*(scalar(@dat_utf8)/2) + 3;
for (my $i=0; $i<scalar(@dat); ) {
local $Data::MessagePack::PreferInteger = 1;
@@ -55,12 +86,18 @@ for (my $i=0; $i<scalar(@dat); ) {
pis $dat[$x], $dat[$y];
}
+for (my $i=0; $i<scalar(@dat_utf8); ) {
+ my($x, $y) = ($i++, $i++);
+ pis_utf8 $dat_utf8[$x], $dat_utf8[$y], 1;
+}
+
# flags working?
{
local $Data::MessagePack::PreferInteger;
$Data::MessagePack::PreferInteger = 1;
pis '0', '00';
$Data::MessagePack::PreferInteger = 0;
- pis '0', 'a1 30';
-}
+ pis '0', 'c4 01 30';
+ pis_utf8 '0', 'a1 30', 0;
+}
diff --git a/t/09_stddata.t b/t/09_stddata.t
index f98d696..835a699 100644
--- a/t/09_stddata.t
+++ b/t/09_stddata.t
@@ -13,30 +13,24 @@ sub slurp {
return scalar <$fh>;
}
-my @data = do {
- my $json = slurp("t/std/cases.json");
- $json =~ s/:/=>/g;
- @{ eval $json };
-};
-
-my $mpac1 = slurp("t/std/cases.mpac");
-my $mpac2 = slurp("t/std/cases_compact.mpac");
+my $mpac = slurp("t/std/cases.mpac");
+my $mpac_compat = slurp("t/std/cases_compact.mpac");
my $mps = Data::MessagePack::Unpacker->new();
+my $mps_compat = Data::MessagePack::Unpacker->new();;
+my $offset = 0;
+my $offset_compat = 0;
my $t = 1;
-for my $mpac($mpac1, $mpac2) {
+while ($offset < length($mpac)) {
note "mpac", $t++;
- my $offset = 0;
- my $i = 0;
- while($offset < length($mpac)) {
- $offset = $mps->execute($mpac, $offset);
- ok $mps->is_finished, "data[$i] : is_finished";
- is_deeply $mps->data, $data[$i], "data[$i]";
- $mps->reset;
- $i++;
- }
+ $offset = $mps->execute($mpac, $offset);
+ $offset_compat = $mps_compat->execute($mpac_compat, $offset_compat);
+ ok $mps->is_finished;
+ is_deeply $mps->data, $mps_compat->data;
+ $mps->reset;
+ $mps_compat->reset;
}
done_testing;
diff --git a/t/data.pl b/t/data.pl
index 0c48fc8..0572e24 100644
--- a/t/data.pl
+++ b/t/data.pl
@@ -54,4 +54,12 @@ no warnings; # i need this, i need this.
'd3 00 10 00 00 00 00 00 00' => '4503599627370496',
'd3 10 00 00 00 00 00 00 00' => '1152921504606846976',
'd3 11 00 00 00 00 00 00 00' => '1224979098644774912',
+
+ 'd9 06 72 65 73 75 6c 74' => "result", # str 8
+ 'da 00 07 73 75 63 63 65 73 73' => "success", # str 16
+ 'db 00 00 00 05 74 6f 6b 65 6e' => "token", # str 32
+
+ 'c4 06 72 65 73 75 6c 74' => "result", # bin 8
+ 'c5 00 07 73 75 63 63 65 73 73' => "success", # bin 16
+ 'c6 00 00 00 05 74 6f 6b 65 6e' => "token", # bin 32
)
diff --git a/t/std/cases.json b/t/std/cases.json
deleted file mode 100644
index fd390d4..0000000
--- a/t/std/cases.json
+++ /dev/null
@@ -1 +0,0 @@
-[false,true,null,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,127,127,255,65535,4294967295,-32,-32,-128,-32768,-2147483648,0.0,-0.0,1.0,-1.0,"a","a","a","","","",[0],[0],[0],[],[],[],{},{},{},{"a":97},{"a":97},{"a":97},[[]],[["a"]]]
\ No newline at end of file
diff --git a/xs-src/pack.c b/xs-src/pack.c
index cec6989..f09a747 100644
--- a/xs-src/pack.c
+++ b/xs-src/pack.c
@@ -158,7 +158,7 @@ STATIC_INLINE int try_int(enc_t* enc, const char *p, size_t len) {
if (negative) {
if (num > 0x80000000) { return 0; }
- msgpack_pack_int32(enc, ((int32_t)num) * -1);
+ msgpack_pack_int32(enc, ((int32_t)-num));
} else {
if (num > 0xFFFFFFFF) { return 0; }
msgpack_pack_uint32(enc, (uint32_t)num);
@@ -168,9 +168,9 @@ STATIC_INLINE int try_int(enc_t* enc, const char *p, size_t len) {
}
-STATIC_INLINE void _msgpack_pack_rv(pTHX_ enc_t *enc, SV* sv, int depth);
+STATIC_INLINE void _msgpack_pack_rv(pTHX_ enc_t *enc, SV* sv, int depth, bool utf8);
-STATIC_INLINE void _msgpack_pack_sv(pTHX_ enc_t* const enc, SV* const sv, int const depth) {
+STATIC_INLINE void _msgpack_pack_sv(pTHX_ enc_t* const enc, SV* const sv, int const depth, bool utf8) {
assert(sv);
if (UNLIKELY(depth <= 0)) Perl_croak(aTHX_ ERR_NESTING_EXCEEDED);
SvGETMAGIC(sv);
@@ -182,8 +182,13 @@ STATIC_INLINE void _msgpack_pack_sv(pTHX_ enc_t* const enc, SV* const sv, int co
if (enc->prefer_int && try_int(enc, pv, len)) {
return;
} else {
- msgpack_pack_raw(enc, len);
- msgpack_pack_raw_body(enc, pv, len);
+ if (utf8) {
+ msgpack_pack_str(enc, len);
+ msgpack_pack_str_body(enc, pv, len);
+ } else {
+ msgpack_pack_bin(enc, len);
+ msgpack_pack_bin_body(enc, pv, len);
+ }
}
} else if (SvNOKp(sv)) {
msgpack_pack_double(enc, (double)SvNVX(sv));
@@ -194,7 +199,7 @@ STATIC_INLINE void _msgpack_pack_sv(pTHX_ enc_t* const enc, SV* const sv, int co
PACK_IV(enc, SvIVX(sv));
}
} else if (SvROK(sv)) {
- _msgpack_pack_rv(aTHX_ enc, SvRV(sv), depth-1);
+ _msgpack_pack_rv(aTHX_ enc, SvRV(sv), depth-1, utf8);
} else if (!SvOK(sv)) {
msgpack_pack_nil(enc);
} else if (isGV(sv)) {
@@ -206,12 +211,12 @@ STATIC_INLINE void _msgpack_pack_sv(pTHX_ enc_t* const enc, SV* const sv, int co
}
STATIC_INLINE
-void _msgpack_pack_he(pTHX_ enc_t* enc, HV* hv, HE* he, int depth) {
- _msgpack_pack_sv(aTHX_ enc, hv_iterkeysv(he), depth);
- _msgpack_pack_sv(aTHX_ enc, hv_iterval(hv, he), depth);
+void _msgpack_pack_he(pTHX_ enc_t* enc, HV* hv, HE* he, int depth, bool utf8) {
+ _msgpack_pack_sv(aTHX_ enc, hv_iterkeysv(he), depth, utf8);
+ _msgpack_pack_sv(aTHX_ enc, hv_iterval(hv, he), depth, utf8);
}
-STATIC_INLINE void _msgpack_pack_rv(pTHX_ enc_t *enc, SV* sv, int depth) {
+STATIC_INLINE void _msgpack_pack_rv(pTHX_ enc_t *enc, SV* sv, int depth, bool utf8) {
svtype svt;
assert(sv);
SvGETMAGIC(sv);
@@ -258,11 +263,11 @@ STATIC_INLINE void _msgpack_pack_rv(pTHX_ enc_t *enc, SV* sv, int depth) {
for (i=0; i<len; i++) {
SV* sv = *av_fetch(keys, i, TRUE);
he = hv_fetch_ent(hval, sv, FALSE, 0U);
- _msgpack_pack_he(aTHX_ enc, hval, he, depth);
+ _msgpack_pack_he(aTHX_ enc, hval, he, depth, utf8);
}
} else {
while ((he = hv_iternext(hval))) {
- _msgpack_pack_he(aTHX_ enc, hval, he, depth);
+ _msgpack_pack_he(aTHX_ enc, hval, he, depth, utf8);
}
}
} else if (svt == SVt_PVAV) {
@@ -273,7 +278,7 @@ STATIC_INLINE void _msgpack_pack_rv(pTHX_ enc_t *enc, SV* sv, int depth) {
for (i=0; i<len; i++) {
SV** svp = av_fetch(ary, i, 0);
if (svp) {
- _msgpack_pack_sv(aTHX_ enc, *svp, depth);
+ _msgpack_pack_sv(aTHX_ enc, *svp, depth, utf8);
} else {
msgpack_pack_nil(enc);
}
@@ -306,6 +311,7 @@ XS(xs_pack) {
SV* self = ST(0);
SV* val = ST(1);
int depth = 512;
+ bool utf8 = false;
if (items >= 3) depth = SvIVx(ST(2));
enc_t enc;
@@ -330,9 +336,14 @@ XS(xs_pack) {
if(svp) {
enc.canonical = SvTRUE(*svp) ? true : false;
}
+
+ svp = hv_fetchs(hv, "utf8", FALSE);
+ if (svp) {
+ utf8 = SvTRUE(*svp) ? true : false;
+ }
}
- _msgpack_pack_sv(aTHX_ &enc, val, depth);
+ _msgpack_pack_sv(aTHX_ &enc, val, depth, utf8);
SvCUR_set(enc.sv, enc.cur - SvPVX (enc.sv));
*SvEND (enc.sv) = 0; /* many xs functions expect a trailing 0 for text strings */
diff --git a/xs-src/unpack.c b/xs-src/unpack.c
index a554b9f..2cefee4 100644
--- a/xs-src/unpack.c
+++ b/xs-src/unpack.c
@@ -257,17 +257,32 @@ STATIC_INLINE int template_callback_map_item(unpack_user* u PERL_UNUSED_DECL, SV
return 0;
}
-STATIC_INLINE int template_callback_raw(unpack_user* u PERL_UNUSED_DECL, const char* b PERL_UNUSED_DECL, const char* p, unsigned int l, SV** o)
+STATIC_INLINE int template_callback_str(unpack_user* u PERL_UNUSED_DECL, const char* b PERL_UNUSED_DECL, const char* p, unsigned int l, SV** o)
{
dTHX;
/* newSVpvn(p, l) returns an undef if p == NULL */
*o = ((l==0) ? newSVpvs("") : newSVpvn(p, l));
+ sv_utf8_decode(*o);
+ return 0;
+}
+
+STATIC_INLINE int template_callback_bin(unpack_user* u PERL_UNUSED_DECL, const char* b PERL_UNUSED_DECL, const char* p, unsigned int l, SV** o)
+{
+ dTHX;
+ *o = ((l==0) ? newSVpvs("") : newSVpvn(p, l));
if(u->utf8) {
sv_utf8_decode(*o);
}
return 0;
}
+STATIC_INLINE int template_callback_ext(unpack_user* u PERL_UNUSED_DECL, const char* b PERL_UNUSED_DECL, const char* p PERL_UNUSED_DECL,
+ unsigned int l PERL_UNUSED_DECL, SV** o PERL_UNUSED_DECL)
+{
+ croak("EXT type is not supporeted yet");
+ return 0;
+}
+
#include "msgpack/unpack_template.h"
#define UNPACKER(from, name) \
@@ -287,8 +302,6 @@ XS(xs_unpack) {
dXSARGS;
SV* const self = ST(0);
SV* const data = ST(1);
- size_t limit;
-
unpack_user u = UNPACK_USER_INIT;
// setup configuration
@@ -302,13 +315,7 @@ XS(xs_unpack) {
}
}
- if (items == 2) {
- limit = sv_len(data);
- }
- else if(items == 3) {
- limit = SvUVx(ST(2));
- }
- else {
+ if (!(items == 2 || items == 3)) {
Perl_croak(aTHX_ "Usage: Data::MessagePack->unpack('data' [, $limit])");
}
diff --git a/xshelper.h b/xshelper.h
index f2416d6..5f1c019 100644
--- a/xshelper.h
+++ b/xshelper.h
@@ -1,4 +1,4 @@
-/* THIS FILE IS AUTOMATICALLY GENERATED BY Module::Install::XSUtil 0.44. */
+/* THIS FILE IS AUTOMATICALLY GENERATED BY Module::Install::XSUtil 0.45. */
/*
=head1 NAME
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdata-messagepack-perl.git
More information about the Pkg-perl-cvs-commits
mailing list