mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-01 09:24:51 +02:00
perl: always unpacking 64 bit ints as a string on 32 bit perls
This commit is contained in:
parent
d6a825981d
commit
5cd37e5505
@ -113,28 +113,18 @@ STATIC_INLINE int template_callback_IV(unpack_user* u PERL_UNUSED_DECL, IV const
|
|||||||
static int template_callback_uint64(unpack_user* u PERL_UNUSED_DECL, uint64_t const d, SV** o)
|
static int template_callback_uint64(unpack_user* u PERL_UNUSED_DECL, uint64_t const d, SV** o)
|
||||||
{
|
{
|
||||||
dTHX;
|
dTHX;
|
||||||
if((uint64_t)(NV)d == d) {
|
char tbuf[64];
|
||||||
*o = newSVnv((NV)d);
|
STRLEN const len = my_snprintf(tbuf, sizeof(tbuf), "%llu", d);
|
||||||
}
|
*o = newSVpvn(tbuf, len);
|
||||||
else {
|
|
||||||
char tbuf[64];
|
|
||||||
STRLEN const len = my_snprintf(tbuf, sizeof(tbuf), "%llu", d);
|
|
||||||
*o = newSVpvn(tbuf, len);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int template_callback_int64(unpack_user* u PERL_UNUSED_DECL, int64_t const d, SV** o)
|
static int template_callback_int64(unpack_user* u PERL_UNUSED_DECL, int64_t const d, SV** o)
|
||||||
{
|
{
|
||||||
dTHX;
|
dTHX;
|
||||||
if((uint64_t)(NV)d == (uint64_t)d) {
|
char tbuf[64];
|
||||||
*o = newSVnv((NV)d);
|
STRLEN const len = my_snprintf(tbuf, sizeof(tbuf), "%lld", d);
|
||||||
}
|
*o = newSVpvn(tbuf, len);
|
||||||
else {
|
|
||||||
char tbuf[64];
|
|
||||||
STRLEN const len = my_snprintf(tbuf, sizeof(tbuf), "%lld", d);
|
|
||||||
*o = newSVpvn(tbuf, len);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user