new IF_HAVE_PERL_5_16 convenience macro
[p5sagit/Function-Parameters.git] / Parameters.xs
index 11e271f..b822303 100644 (file)
@@ -61,6 +61,12 @@ WARNINGS_ENABLE
 #define HAVE_PERL_VERSION(R, V, S) \
        (PERL_REVISION > (R) || (PERL_REVISION == (R) && (PERL_VERSION > (V) || (PERL_VERSION == (V) && (PERL_SUBVERSION >= (S))))))
 
+#if HAVE_PERL_VERSION(5, 16, 0)
+ #define IF_HAVE_PERL_5_16(YES, NO) YES
+#else
+ #define IF_HAVE_PERL_5_16(YES, NO) NO
+#endif
+
 typedef struct {
        enum {
                FLAG_NAME_OPTIONAL = 1,
@@ -140,7 +146,6 @@ static int kw_flags(pTHX_ const char *kw_ptr, STRLEN kw_len, Spec *spec) {
 
 static int parse_fun(pTHX_ OP **pop, const char *keyword_ptr, STRLEN keyword_len, const Spec *spec) {
        SV *gen, *declarator, *params, *sv;
-       line_t line_start;
        int saw_name, saw_colon;
        STRLEN len;
        char *s;
@@ -150,7 +155,6 @@ static int parse_fun(pTHX_ OP **pop, const char *keyword_ptr, STRLEN keyword_len
        declarator = sv_2mortal(newSVpvn(keyword_ptr, keyword_len));
        params = sv_2mortal(newSVpvs(""));
 
-       line_start = CopLINE(PL_curcop);
        lex_read_space(0);
 
        /* function name */