mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-18 20:38:00 +01:00
Use xshelper.h in all the C files
This commit is contained in:
parent
1242ffa4c6
commit
987248ccbb
@ -25,4 +25,3 @@
|
|||||||
^Data-MessagePack-[0-9.]+/
|
^Data-MessagePack-[0-9.]+/
|
||||||
^\.testenv/test_pp.pl
|
^\.testenv/test_pp.pl
|
||||||
^ppport.h$
|
^ppport.h$
|
||||||
^xshelper.h$
|
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
/*
|
|
||||||
perlxs.h - Standard XS header file
|
|
||||||
Copyright (c) Fuji, Goro (gfx)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define PERL_NO_GET_CONTEXT /* we want efficiency */
|
|
||||||
#include <EXTERN.h>
|
|
||||||
|
|
||||||
#include <perl.h>
|
|
||||||
#define NO_XSLOCKS /* for exceptions */
|
|
||||||
#include <XSUB.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ppport.h"
|
|
||||||
|
|
||||||
/* portability stuff not supported by ppport.h yet */
|
|
||||||
|
|
||||||
#ifndef STATIC_INLINE /* from 5.13.4 */
|
|
||||||
# if defined(__GNUC__) || defined(__cplusplus__) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
|
|
||||||
# define STATIC_INLINE static inline
|
|
||||||
# else
|
|
||||||
# define STATIC_INLINE static
|
|
||||||
# endif
|
|
||||||
#endif /* STATIC_INLINE */
|
|
||||||
|
|
||||||
#ifndef __attribute__format__
|
|
||||||
#define __attribute__format__(a,b,c) /* nothing */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LIKELY /* they are just a compiler's hint */
|
|
||||||
#define LIKELY(x) (x)
|
|
||||||
#define UNLIKELY(x) (x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef newSVpvs_share
|
|
||||||
#define newSVpvs_share(s) Perl_newSVpvn_share(aTHX_ STR_WITH_LEN(s), 0U)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef get_cvs
|
|
||||||
#define get_cvs(name, flags) get_cv(name, flags)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef GvNAME_get
|
|
||||||
#define GvNAME_get GvNAME
|
|
||||||
#endif
|
|
||||||
#ifndef GvNAMELEN_get
|
|
||||||
#define GvNAMELEN_get GvNAMELEN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CvGV_set
|
|
||||||
#define CvGV_set(cv, gv) (CvGV(cv) = (gv))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* general utility */
|
|
||||||
|
|
||||||
#if PERL_BCDVERSION >= 0x5008005
|
|
||||||
#define LooksLikeNumber(x) looks_like_number(x)
|
|
||||||
#else
|
|
||||||
#define LooksLikeNumber(x) (SvPOKp(x) ? looks_like_number(x) : (I32)SvNIOKp(x))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define newAV_mortal() (AV*)sv_2mortal((SV*)newAV())
|
|
||||||
#define newHV_mortal() (HV*)sv_2mortal((SV*)newHV())
|
|
||||||
|
|
||||||
#define DECL_BOOT(name) EXTERN_C XS(CAT2(boot_, name))
|
|
||||||
#define CALL_BOOT(name) STMT_START { \
|
|
||||||
PUSHMARK(SP); \
|
|
||||||
CALL_FPTR(CAT2(boot_, name))(aTHX_ cv); \
|
|
||||||
} STMT_END
|
|
11
perl/util.h
11
perl/util.h
@ -1,11 +0,0 @@
|
|||||||
#ifndef __PERL_MSGPACK_UTIL_H__
|
|
||||||
#define __PERL_MSGPACK_UTIL_H__
|
|
||||||
|
|
||||||
#if __GNUC__ >= 3
|
|
||||||
# define INLINE inline
|
|
||||||
#else
|
|
||||||
# define INLINE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // __PERL_MSGPACK_UTIL_H__
|
|
||||||
|
|
@ -1,14 +1,4 @@
|
|||||||
#ifdef __cplusplus
|
#include "xshelper.h"
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
#include "EXTERN.h"
|
|
||||||
#include "perl.h"
|
|
||||||
#include "XSUB.h"
|
|
||||||
#define NEED_newCONSTSUB
|
|
||||||
#include "ppport.h"
|
|
||||||
#ifdef __cplusplus
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
XS(xs_pack);
|
XS(xs_pack);
|
||||||
XS(xs_unpack);
|
XS(xs_unpack);
|
||||||
@ -24,13 +14,11 @@ void boot_Data__MessagePack_pack(void);
|
|||||||
|
|
||||||
XS(boot_Data__MessagePack) {
|
XS(boot_Data__MessagePack) {
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
HV * stash;
|
|
||||||
|
|
||||||
boot_Data__MessagePack_pack();
|
boot_Data__MessagePack_pack();
|
||||||
|
|
||||||
newXS("Data::MessagePack::pack", xs_pack, __FILE__);
|
newXS("Data::MessagePack::pack", xs_pack, __FILE__);
|
||||||
newXS("Data::MessagePack::unpack", xs_unpack, __FILE__);
|
newXS("Data::MessagePack::unpack", xs_unpack, __FILE__);
|
||||||
stash = gv_stashpvn("Data::MessagePack", strlen("Data::MessagePack"), TRUE);
|
|
||||||
|
|
||||||
newXS("Data::MessagePack::Unpacker::new", xs_unpacker_new, __FILE__);
|
newXS("Data::MessagePack::Unpacker::new", xs_unpacker_new, __FILE__);
|
||||||
newXS("Data::MessagePack::Unpacker::execute", xs_unpacker_execute, __FILE__);
|
newXS("Data::MessagePack::Unpacker::execute", xs_unpacker_execute, __FILE__);
|
||||||
|
@ -1,15 +1,7 @@
|
|||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NEED_newRV_noinc
|
#define NEED_newRV_noinc
|
||||||
#define NEED_sv_2pv_flags
|
#define NEED_sv_2pv_flags
|
||||||
#include "xshelper.h"
|
#include "xshelper.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int finished;
|
int finished;
|
||||||
SV* source;
|
SV* source;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user