Skip to content

SvRX and RX_* macros #241

@nrdvana

Description

@nrdvana

When I use PPPort 3.68 with the following compiled under perl 5.8.9,

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#define NEED_mg_findext
#define NEED_newSVpvn_share
#define NEED_SvRX
#define NEED_RX_PRECOMP
#define NEED_RX_PRELEN
#define NEED_RX_EXTFLAGS
#include "ppport.h"

I get an SvRX macro that returns SV* instead of REGEXP*, and the macros RX_PRECOMP, RX_PRELEN, and RX_EXTFLAGS are still not defined. The relevant lines of ppport.h seem to be:

SvRX|5.009005|5.003007|p
RX_PRECOMP|5.010001||Viu
RX_PRELEN|5.010001||Viu
RX_EXTFLAGS|5.010001||Viu
...
#ifndef SvRX
#  define SvRX(rv)                       (SvROK((rv)) ? (SvMAGICAL(SvRV((rv))) ? (mg_find(SvRV((rv)), PERL_MAGIC_qr) ? mg_find(SvRV((rv)), PERL_MAGIC_qr)->mg_obj : NULL) : NULL) : NULL)
#endif

It seems that while the RX_ macros are documented for what version added them, there isn't any implementation?

Is there a reason for this, or is this a "patches welcome" sort of omission?

Also, putting a (REGEXP*) typecast at the start of the SvRX macro seems like the right thing to do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions