mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-21 07:45:02 +02:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a5705183d6 | ||
![]() |
95a6316cc7 | ||
![]() |
be32e3b1fb | ||
![]() |
b4cb5e23c0 |
@@ -1,6 +1,6 @@
|
||||
AC_INIT(msgpack/unpack_template.h)
|
||||
AC_CONFIG_AUX_DIR(ac)
|
||||
AM_INIT_AUTOMAKE(msgpack, 0.3.4)
|
||||
AM_INIT_AUTOMAKE(msgpack, 0.3.5)
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
|
@@ -39,10 +39,12 @@ msgpack/zone.hpp: msgpack/zone.hpp.erb
|
||||
|
||||
MOSTLYCLEANFILES = \
|
||||
msgpack/type/tuple.hpp \
|
||||
msgpack/type/define.hpp \
|
||||
msgpack/zone.hpp
|
||||
|
||||
EXTRA_DIST = \
|
||||
msgpack/type/tuple.hpp.erb \
|
||||
msgpack/type/define.hpp.erb \
|
||||
msgpack/zone.hpp.erb
|
||||
|
||||
libmsgpack_la_LIBADD = -L../c -lmsgpackc
|
||||
|
@@ -52,7 +52,6 @@ struct define<> {
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
}
|
||||
};
|
||||
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
||||
@@ -79,11 +78,10 @@ struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
||||
};
|
||||
<%}%>
|
||||
|
||||
define<> make_define()
|
||||
inline define<> make_define()
|
||||
{
|
||||
return define<>();
|
||||
}
|
||||
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_define(A0& a0<%1.upto(i) {|j|%>, A<%=j%>& a<%=j%><%}%>)
|
||||
@@ -92,7 +90,6 @@ define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_define(A0& a0<%1.upto(i) {|j|%>,
|
||||
}
|
||||
<%}%>
|
||||
|
||||
|
||||
} // namespace type
|
||||
} // namespace msgpack
|
||||
|
||||
|
@@ -64,7 +64,6 @@ struct tuple_type<const T&> {
|
||||
typedef const T& transparent_reference;
|
||||
};
|
||||
|
||||
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
<%0.upto(i) {|j|%>
|
||||
template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>>
|
||||
@@ -78,7 +77,6 @@ private:
|
||||
<%}%>
|
||||
<%}%>
|
||||
|
||||
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
<%0.upto(i) {|j|%>
|
||||
template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>>
|
||||
@@ -91,16 +89,6 @@ private:
|
||||
<%}%>
|
||||
<%}%>
|
||||
|
||||
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>)
|
||||
{
|
||||
return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
|
||||
template <>
|
||||
struct tuple<> {
|
||||
typedef tuple<> value_type;
|
||||
@@ -122,6 +110,18 @@ struct tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
|
||||
};
|
||||
<%}%>
|
||||
|
||||
inline tuple<> make_tuple()
|
||||
{
|
||||
return tuple<>();
|
||||
}
|
||||
<%0.upto(GENERATION_LIMIT) {|i|%>
|
||||
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
|
||||
tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>)
|
||||
{
|
||||
return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>);
|
||||
}
|
||||
<%}%>
|
||||
|
||||
} // namespace type
|
||||
|
||||
|
||||
@@ -144,7 +144,6 @@ type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& operator>> (
|
||||
}
|
||||
<%}%>
|
||||
|
||||
|
||||
template <typename Stream>
|
||||
const packer<Stream>& operator<< (
|
||||
packer<Stream>& o,
|
||||
@@ -164,7 +163,6 @@ const packer<Stream>& operator<< (
|
||||
}
|
||||
<%}%>
|
||||
|
||||
|
||||
} // namespace msgpack
|
||||
|
||||
#endif /* msgpack/type/tuple.hpp */
|
||||
|
@@ -22,14 +22,14 @@ public:
|
||||
ssize_t count =
|
||||
read(m_sock, m_pac.buffer(), m_pac.buffer_capacity());
|
||||
|
||||
if(count < 0) {
|
||||
if(count <= 0) {
|
||||
if(count == 0) {
|
||||
throw std::runtime_error("connection closed");
|
||||
}
|
||||
if(errno == EAGAIN || errno == EINTR) {
|
||||
return;
|
||||
} else {
|
||||
throw std::runtime_error(strerror(errno));
|
||||
}
|
||||
} else if(count == 0) {
|
||||
throw std::runtime_error("connection closed");
|
||||
throw std::runtime_error(strerror(errno));
|
||||
}
|
||||
|
||||
m_pac.buffer_consumed(count);
|
||||
|
Reference in New Issue
Block a user