Apd |int |vcmp |NN SV *lhv|NN SV *rhv
: Used in pp_hot.c and pp_sys.c
p |PerlIO*|nextargv |NN GV* gv|bool nomagicopen
+#ifdef HAS_MEMMEM
+AdnopP |char* |ninstr |NN const char* big|NN const char* bigend \
+ |NN const char* little|NN const char* lend
+#else
AdnpP |char* |ninstr |NN const char* big|NN const char* bigend \
|NN const char* little|NN const char* lend
+#endif
Apd |void |op_free |NULLOK OP* arg
Mp |OP* |op_unscope |NULLOK OP* o
#ifdef PERL_CORE
#define new_numeric(a) Perl_new_numeric(aTHX_ a)
#define new_stackinfo(a,b) Perl_new_stackinfo(aTHX_ a,b)
#define new_version(a) Perl_new_version(aTHX_ a)
-#define ninstr Perl_ninstr
#define nothreadhook() Perl_nothreadhook(aTHX)
#define op_append_elem(a,b,c) Perl_op_append_elem(aTHX_ a,b,c)
#define op_append_list(a,b,c) Perl_op_append_list(aTHX_ a,b,c)
#define whichsig_pvn(a,b) Perl_whichsig_pvn(aTHX_ a,b)
#define whichsig_sv(a) Perl_whichsig_sv(aTHX_ a)
#define wrap_op_checker(a,b,c) Perl_wrap_op_checker(aTHX_ a,b,c)
+#if !(defined(HAS_MEMMEM))
+#define ninstr Perl_ninstr
+#endif
#if !(defined(HAS_SIGACTION) && defined(SA_SIGINFO))
#define csighandler Perl_csighandler
#endif
PERL_CALLCONV PerlIO* Perl_nextargv(pTHX_ GV* gv, bool nomagicopen);
#define PERL_ARGS_ASSERT_NEXTARGV \
assert(gv)
-PERL_CALLCONV char* Perl_ninstr(const char* big, const char* bigend, const char* little, const char* lend)
- __attribute__pure__;
-#define PERL_ARGS_ASSERT_NINSTR \
- assert(big); assert(bigend); assert(little); assert(lend)
-
PERL_CALLCONV_NO_RET void Perl_noperl_die(const char* pat, ...)
__attribute__noreturn__
__attribute__format__(__printf__,1,2);
# endif
# endif
#endif
+#if !(defined(HAS_MEMMEM))
+PERL_CALLCONV char* Perl_ninstr(const char* big, const char* bigend, const char* little, const char* lend)
+ __attribute__pure__;
+#define PERL_ARGS_ASSERT_NINSTR \
+ assert(big); assert(bigend); assert(little); assert(lend)
+
+#endif
#if !(defined(HAS_SIGACTION) && defined(SA_SIGINFO))
PERL_CALLCONV Signal_t Perl_csighandler(int sig);
PERL_CALLCONV Signal_t Perl_sighandler(int sig);
#define PERL_ARGS_ASSERT_DUMP_SV_CHILD \
assert(sv)
#endif
+#if defined(HAS_MEMMEM)
+PERL_CALLCONV char* Perl_ninstr(const char* big, const char* bigend, const char* little, const char* lend)
+ __attribute__pure__;
+#define PERL_ARGS_ASSERT_NINSTR \
+ assert(big); assert(bigend); assert(little); assert(lend)
+
+#endif
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
PERL_CALLCONV I32 Perl_do_ipcctl(pTHX_ I32 optype, SV** mark, SV** sp);
#define PERL_ARGS_ASSERT_DO_IPCCTL \
Perl_ninstr(const char *big, const char *bigend, const char *little, const char *lend)
{
PERL_ARGS_ASSERT_NINSTR;
+
+#ifdef HAS_MEMMEM
+ return ninstr(big, bigend, little, lend);
+#else
+
if (little >= lend)
return (char*)big;
{
}
}
return NULL;
+
+#endif
+
}
/*
#define instr(haystack, needle) strstr(haystack, needle)
+#ifdef HAS_MEMMEM
+# define ninstr(big, bigend, little, lend) \
+ ((char *) memmem(big, bigend - big, little, lend - little))
+#endif
+
/*
* ex: set ts=8 sts=4 sw=4 et:
*/