mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-01 01:16:52 +02:00
perl: enhancement portability
This commit is contained in:
parent
8c62d93bca
commit
5710b87b06
@ -4,6 +4,7 @@ extern "C" {
|
|||||||
#include "EXTERN.h"
|
#include "EXTERN.h"
|
||||||
#include "perl.h"
|
#include "perl.h"
|
||||||
#include "XSUB.h"
|
#include "XSUB.h"
|
||||||
|
#define NEED_newCONSTSUB
|
||||||
#include "ppport.h"
|
#include "ppport.h"
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
};
|
};
|
||||||
|
@ -27,7 +27,6 @@ extern "C" {
|
|||||||
#define _PACK_WRAPPER(t) msgpack_pack_##t
|
#define _PACK_WRAPPER(t) msgpack_pack_##t
|
||||||
#define PACK_WRAPPER(t) _PACK_WRAPPER(t)
|
#define PACK_WRAPPER(t) _PACK_WRAPPER(t)
|
||||||
|
|
||||||
// move to pack.c
|
|
||||||
static void _msgpack_pack_sv(SV* buf, SV* val) {
|
static void _msgpack_pack_sv(SV* buf, SV* val) {
|
||||||
if (val==NULL) {
|
if (val==NULL) {
|
||||||
msgpack_pack_nil(buf);
|
msgpack_pack_nil(buf);
|
||||||
|
@ -5,6 +5,8 @@ extern "C" {
|
|||||||
#include "EXTERN.h"
|
#include "EXTERN.h"
|
||||||
#include "perl.h"
|
#include "perl.h"
|
||||||
#include "XSUB.h"
|
#include "XSUB.h"
|
||||||
|
#define NEED_newRV_noinc
|
||||||
|
#define NEED_sv_2pv_flags
|
||||||
#include "ppport.h"
|
#include "ppport.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -87,7 +89,7 @@ static inline int template_callback_array(unpack_user* u, unsigned int n, SV** o
|
|||||||
{ AV* a = newAV(); *o = (SV*)newRV_noinc((SV*)a); av_extend(a, n); return 0; }
|
{ AV* a = newAV(); *o = (SV*)newRV_noinc((SV*)a); av_extend(a, n); return 0; }
|
||||||
|
|
||||||
static inline int template_callback_array_item(unpack_user* u, SV** c, SV* o)
|
static inline int template_callback_array_item(unpack_user* u, SV** c, SV* o)
|
||||||
{ av_push((AV*)SvRV(*c), o); SvREFCNT_inc(o); return 0; } // FIXME set value directry RARRAY_PTR(obj)[RARRAY_LEN(obj)++]
|
{ av_push((AV*)SvRV(*c), o); SvREFCNT_inc(o); return 0; } /* FIXME set value directry RARRAY_PTR(obj)[RARRAY_LEN(obj)++] */
|
||||||
|
|
||||||
static inline int template_callback_map(unpack_user* u, unsigned int n, SV** o)
|
static inline int template_callback_map(unpack_user* u, unsigned int n, SV** o)
|
||||||
{ HV * h = newHV(); *o = newRV_noinc((SV*)h); return 0; }
|
{ HV * h = newHV(); *o = newRV_noinc((SV*)h); return 0; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user