mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-19 04:33:27 +02:00
Fixed #191.
The names of float format family are changed. old new dec -> f64 MSGPACK_OBJECT_DOUBLE -> MSGPACK_OBJECT_FLOAT msgpack::type::DOUBLE -> msgpack::type::FLOAT Client codes could have compile errors when it use dec, MSGPACK_OBJECT_DOUBLE or msgpack::type::DOUBLE. The best way to fix such errors, update client code. If it can't, set MSGPACK_USE_LEGACY_NAME_AS_FLOAT macro. Then both old names and new names are available.
This commit is contained in:
@@ -159,16 +159,16 @@ static inline int template_callback_int64(unpack_user* u, int64_t d, msgpack_obj
|
||||
static inline int template_callback_float(unpack_user* u, float d, msgpack_object* o)
|
||||
{
|
||||
MSGPACK_UNUSED(u);
|
||||
o->type = MSGPACK_OBJECT_DOUBLE;
|
||||
o->via.dec = d;
|
||||
o->type = MSGPACK_OBJECT_FLOAT;
|
||||
o->via.f64 = d;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int template_callback_double(unpack_user* u, double d, msgpack_object* o)
|
||||
{
|
||||
MSGPACK_UNUSED(u);
|
||||
o->type = MSGPACK_OBJECT_DOUBLE;
|
||||
o->via.dec = d;
|
||||
o->type = MSGPACK_OBJECT_FLOAT;
|
||||
o->via.f64 = d;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user