mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-20 21:39:53 +01:00
cpp: adds MSGPACK_VERSION{,_MAJOR,_MINOR} macros and msgpack{,_major,_minor} functions
This commit is contained in:
parent
b3987e2402
commit
3af10a1d00
@ -12,7 +12,6 @@ EXTRA_DIST = \
|
||||
$(DOC_FILES)
|
||||
|
||||
doxygen:
|
||||
./preprocess
|
||||
./preprocess clean
|
||||
cd src && $(MAKE) doxygen
|
||||
./preprocess
|
||||
|
@ -54,5 +54,10 @@ add CFLAGS="--march=i686" and CXXFLAGS="-march=i686" options to ./configure as f
|
||||
])
|
||||
fi
|
||||
|
||||
major=`echo $VERSION | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
|
||||
minor=`echo $VERSION | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
|
||||
AC_SUBST(VERSION_MAJOR, $major)
|
||||
AC_SUBST(VERSION_MINOR, $minor)
|
||||
|
||||
AC_OUTPUT([Makefile src/Makefile test/Makefile])
|
||||
|
||||
|
@ -4,6 +4,7 @@ lib_LTLIBRARIES = libmsgpack.la
|
||||
libmsgpack_la_SOURCES = \
|
||||
unpack.c \
|
||||
objectc.c \
|
||||
version.c \
|
||||
vrefbuffer.c \
|
||||
zone.c \
|
||||
object.cpp
|
||||
@ -18,15 +19,12 @@ lib_LTLIBRARIES += libmsgpackc.la
|
||||
libmsgpackc_la_SOURCES = \
|
||||
unpack.c \
|
||||
objectc.c \
|
||||
version.c \
|
||||
vrefbuffer.c \
|
||||
zone.c
|
||||
|
||||
libmsgpackc_la_LDFLAGS = -version-info 2:0:0
|
||||
|
||||
# work around for duplicated file name
|
||||
kumo_manager_CFLAGS = $(AM_CFLAGS)
|
||||
kumo_manager_CXXFLAGS = $(AM_CXXFLAGS)
|
||||
|
||||
|
||||
nobase_include_HEADERS = \
|
||||
msgpack/pack_define.h \
|
||||
@ -44,6 +42,7 @@ nobase_include_HEADERS = \
|
||||
msgpack/zone.h \
|
||||
msgpack.hpp \
|
||||
msgpack/sbuffer.hpp \
|
||||
msgpack/version.h \
|
||||
msgpack/vrefbuffer.hpp \
|
||||
msgpack/zbuffer.hpp \
|
||||
msgpack/pack.hpp \
|
||||
@ -69,11 +68,19 @@ nobase_include_HEADERS = \
|
||||
msgpack/type/tr1/unordered_set.hpp
|
||||
|
||||
EXTRA_DIST = \
|
||||
msgpack/version.h.in \
|
||||
msgpack/zone.hpp.erb \
|
||||
msgpack/type/define.hpp.erb \
|
||||
msgpack/type/tuple.hpp.erb
|
||||
|
||||
|
||||
msgpack/version.h: msgpack/version.h.in Makefile.in
|
||||
sed -e s/VERSION_UNDEFINED/$(VERSION)/ \
|
||||
-e s/VERSION_MAJOR_UNDEFINED/$(VERSION_MAJOR)/ \
|
||||
-e s/VERSION_MINOR_UNDEFINED/$(VERSION_MINOR)/ \
|
||||
$< > $@
|
||||
|
||||
|
||||
doxygen_c:
|
||||
cat ../Doxyfile > Doxyfile_c
|
||||
echo "FILE_PATTERNS = *.h" >> Doxyfile_c
|
||||
|
@ -26,3 +26,5 @@
|
||||
#include "msgpack/unpack.h"
|
||||
#include "msgpack/sbuffer.h"
|
||||
#include "msgpack/vrefbuffer.h"
|
||||
#include "msgpack/version.h"
|
||||
|
||||
|
40
cpp/src/msgpack/version.h.in
Normal file
40
cpp/src/msgpack/version.h.in
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* MessagePack for C version information
|
||||
*
|
||||
* Copyright (C) 2008-2009 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.
|
||||
*/
|
||||
#ifndef MSGPACK_VERSION_H__
|
||||
#define MSGPACK_VERSION_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
const char* msgpack_version(void);
|
||||
int msgpack_version_major(void);
|
||||
int msgpack_version_minor(void);
|
||||
|
||||
#define MSGPACK_VERSION "VERSION_UNDEFINED"
|
||||
#define MSGPACK_VERSION_MAJOR VERSION_MAJOR_UNDEFINED
|
||||
#define MSGPACK_VERSION_MINOR VERSION_MINOR_UNDEFINED
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* msgpack/version.h */
|
||||
|
17
cpp/src/version.c
Normal file
17
cpp/src/version.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include "msgpack.h"
|
||||
|
||||
const char* msgpack_version(void)
|
||||
{
|
||||
return MSGPACK_VERSION;
|
||||
}
|
||||
|
||||
int msgpack_version_major(void)
|
||||
{
|
||||
return MSGPACK_VERSION_MAJOR;
|
||||
}
|
||||
|
||||
int msgpack_version_minor(void)
|
||||
{
|
||||
return MSGPACK_VERSION_MINOR;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ check_PROGRAMS = \
|
||||
convert \
|
||||
buffer \
|
||||
cases \
|
||||
version \
|
||||
msgpackc_test \
|
||||
msgpack_test
|
||||
|
||||
@ -37,6 +38,8 @@ buffer_LDADD = -lz
|
||||
|
||||
cases_SOURCES = cases.cc
|
||||
|
||||
version_SOURCES = version.cc
|
||||
|
||||
msgpackc_test_SOURCES = msgpackc_test.cpp
|
||||
|
||||
msgpack_test_SOURCES = msgpack_test.cpp
|
||||
|
Loading…
x
Reference in New Issue
Block a user