summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/re/re.xs10
-rw-r--r--intrpvar.h2
-rw-r--r--op.c2
-rw-r--r--perl.c22
-rw-r--r--perl.h8
-rw-r--r--pp_ctl.c20
-rw-r--r--scope.h3
-rw-r--r--sv.c8
-rw-r--r--thrdvar.h12
-rw-r--r--util.c12
-rw-r--r--win32/Makefile7
-rw-r--r--win32/makefile.mk16
-rw-r--r--win32/win32.c7
-rw-r--r--win32/win32.h4
14 files changed, 65 insertions, 68 deletions
diff --git a/ext/re/re.xs b/ext/re/re.xs
index 98ffd74e12..04a5fdc742 100644
--- a/ext/re/re.xs
+++ b/ext/re/re.xs
@@ -26,11 +26,11 @@ static void
deinstall(pTHX)
{
dTHR;
- PL_regexecp = FUNC_NAME_TO_PTR(Perl_regexec_flags);
- PL_regcompp = FUNC_NAME_TO_PTR(Perl_pregcomp);
- PL_regint_start = FUNC_NAME_TO_PTR(Perl_re_intuit_start);
- PL_regint_string = FUNC_NAME_TO_PTR(Perl_re_intuit_string);
- PL_regfree = FUNC_NAME_TO_PTR(Perl_pregfree);
+ PL_regexecp = Perl_regexec_flags;
+ PL_regcompp = Perl_pregcomp;
+ PL_regint_start = Perl_re_intuit_start;
+ PL_regint_string = Perl_re_intuit_string;
+ PL_regfree = Perl_pregfree;
if (!oldfl)
PL_debug &= ~R_DB;
diff --git a/intrpvar.h b/intrpvar.h
index 0b9dfa62d2..65ab5c64fc 100644
--- a/intrpvar.h
+++ b/intrpvar.h
@@ -226,7 +226,7 @@ PERLVAR(Ihe_root, HE *) /* free he list--shared by interpreters */
PERLVAR(Inice_chunk, char *) /* a nice chunk of memory to reuse */
PERLVAR(Inice_chunk_size, U32) /* how nice the chunk of memory is */
-PERLVARI(Irunops, runops_proc_t, FUNC_NAME_TO_PTR(RUNOPS_DEFAULT))
+PERLVARI(Irunops, runops_proc_t, MEMBER_TO_FPTR(RUNOPS_DEFAULT))
PERLVARA(Itokenbuf,256, char)
diff --git a/op.c b/op.c
index 858bf00f8b..ae6297c7e0 100644
--- a/op.c
+++ b/op.c
@@ -677,7 +677,7 @@ Perl_op_free(pTHX_ OP *o)
#endif /* USE_THREADS */
default:
if (!(o->op_flags & OPf_REF)
- || (PL_check[o->op_type] != FUNC_NAME_TO_PTR(Perl_ck_ftst)))
+ || (PL_check[o->op_type] != MEMBER_TO_FPTR(Perl_ck_ftst)))
break;
/* FALL THROUGH */
case OP_GVSV:
diff --git a/perl.c b/perl.c
index bb3f2a90eb..8db7c21764 100644
--- a/perl.c
+++ b/perl.c
@@ -110,7 +110,7 @@ perl_construct(pTHXx)
thr = init_main_thread();
#endif /* USE_THREADS */
- PL_protect = FUNC_NAME_TO_PTR(Perl_default_protect); /* for exceptions */
+ PL_protect = MEMBER_TO_FPTR(Perl_default_protect); /* for exceptions */
PL_curcop = &PL_compiling; /* needed by ckWARN, right away */
@@ -626,7 +626,7 @@ setuid perl scripts securely.\n");
oldscope = PL_scopestack_ix;
PL_dowarn = G_WARN_OFF;
- CALLPROTECT(aTHX_ &ret, FUNC_NAME_TO_PTR(S_parse_body), env, xsinit);
+ CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_parse_body), env, xsinit);
switch (ret) {
case 0:
return 0;
@@ -999,7 +999,7 @@ perl_run(pTHXx)
oldscope = PL_scopestack_ix;
redo_body:
- CALLPROTECT(aTHX_ &ret, FUNC_NAME_TO_PTR(S_run_body), oldscope);
+ CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_run_body), oldscope);
switch (ret) {
case 1:
cxstack_ix = -1; /* start context stack again */
@@ -1254,7 +1254,7 @@ Perl_call_sv(pTHX_ SV *sv, I32 flags)
PL_markstack_ptr++;
redo_body:
- CALLPROTECT(aTHX_ &ret, FUNC_NAME_TO_PTR(S_call_body), (OP*)&myop, FALSE);
+ CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_call_body), (OP*)&myop, FALSE);
switch (ret) {
case 0:
retval = PL_stack_sp - (PL_stack_base + oldmark);
@@ -1376,7 +1376,7 @@ Perl_eval_sv(pTHX_ SV *sv, I32 flags)
myop.op_flags |= OPf_SPECIAL;
redo_body:
- CALLPROTECT(aTHX_ &ret, FUNC_NAME_TO_PTR(S_call_body), (OP*)&myop, TRUE);
+ CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_call_body), (OP*)&myop, TRUE);
switch (ret) {
case 0:
retval = PL_stack_sp - (PL_stack_base + oldmark);
@@ -2936,11 +2936,11 @@ S_init_main_thread(pTHX)
(void) find_threadsv("@"); /* Ensure $@ is initialised early */
PL_maxscream = -1;
- PL_regcompp = FUNC_NAME_TO_PTR(Perl_pregcomp);
- PL_regexecp = FUNC_NAME_TO_PTR(Perl_regexec_flags);
- PL_regint_start = FUNC_NAME_TO_PTR(Perl_re_intuit_start);
- PL_regint_string = FUNC_NAME_TO_PTR(Perl_re_intuit_string);
- PL_regfree = FUNC_NAME_TO_PTR(Perl_pregfree);
+ PL_regcompp = MEMBER_TO_FPTR(Perl_pregcomp);
+ PL_regexecp = MEMBER_TO_FPTR(Perl_regexec_flags);
+ PL_regint_start = MEMBER_TO_FPTR(Perl_re_intuit_start);
+ PL_regint_string = MEMBER_TO_FPTR(Perl_re_intuit_string);
+ PL_regfree = MEMBER_TO_FPTR(Perl_pregfree);
PL_regindent = 0;
PL_reginterp_cnt = 0;
@@ -2961,7 +2961,7 @@ Perl_call_list(pTHX_ I32 oldscope, AV *paramList)
while (AvFILL(paramList) >= 0) {
cv = (CV*)av_shift(paramList);
SAVEFREESV(cv);
- CALLPROTECT(aTHX_ &ret, FUNC_NAME_TO_PTR(S_call_list_body), cv);
+ CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_call_list_body), cv);
switch (ret) {
case 0:
(void)SvPV(atsv, len);
diff --git a/perl.h b/perl.h
index 07dada4704..b8f9ae6934 100644
--- a/perl.h
+++ b/perl.h
@@ -1494,10 +1494,6 @@ typedef union any ANY;
# endif
#endif
-#ifndef FUNC_NAME_TO_PTR
-#define FUNC_NAME_TO_PTR(name) name
-#endif
-
/*
* USE_THREADS needs to be after unixish.h as <pthread.h> includes
* <sys/signal.h> which defines NSIG - which will stop inclusion of <signal.h>
@@ -1593,6 +1589,10 @@ typedef pthread_key_t perl_key;
# define STATUS_ALL_FAILURE (PL_statusvalue = 1)
#endif
+#ifndef MEMBER_TO_FPTR
+#define MEMBER_TO_FPTR(name) name
+#endif
+
/* This defines a way to flush all output buffers. This may be a
* performance issue, so we allow people to disable it.
* XXX the default needs a Configure test, as it may not work everywhere.
diff --git a/pp_ctl.c b/pp_ctl.c
index d7fec162b4..77a48493de 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -870,7 +870,7 @@ PP(pp_sort)
(void)SvREFCNT_inc(cv); /* in preparation for POPSUB */
}
PL_sortcxix = cxstack_ix;
- qsortsv((myorigmark+1), max, FUNC_NAME_TO_PTR(sortcv));
+ qsortsv((myorigmark+1), max, sortcv);
POPBLOCK(cx,PL_curpm);
PL_stack_sp = newsp;
@@ -884,19 +884,13 @@ PP(pp_sort)
qsortsv(ORIGMARK+1, max,
(PL_op->op_private & OPpSORT_NUMERIC)
? ( (PL_op->op_private & OPpSORT_INTEGER)
- ? ( overloading
- ? FUNC_NAME_TO_PTR(amagic_i_ncmp)
- : FUNC_NAME_TO_PTR(sv_i_ncmp))
- : ( overloading
- ? FUNC_NAME_TO_PTR(amagic_ncmp)
- : FUNC_NAME_TO_PTR(sv_ncmp)))
+ ? ( overloading ? amagic_i_ncmp : sv_i_ncmp)
+ : ( overloading ? amagic_ncmp : sv_ncmp))
: ( (PL_op->op_private & OPpLOCALE)
? ( overloading
- ? FUNC_NAME_TO_PTR(amagic_cmp_locale)
- : FUNC_NAME_TO_PTR(sv_cmp_locale_static))
- : ( overloading
- ? FUNC_NAME_TO_PTR(amagic_cmp)
- : FUNC_NAME_TO_PTR(sv_cmp_static) )));
+ ? amagic_cmp_locale
+ : sv_cmp_locale_static)
+ : ( overloading ? amagic_cmp : sv_cmp_static)));
if (PL_op->op_private & OPpSORT_REVERSE) {
SV **p = ORIGMARK+1;
SV **q = ORIGMARK+max;
@@ -2427,7 +2421,7 @@ S_docatch(pTHX_ OP *o)
#endif
PL_op = o;
redo_body:
- CALLPROTECT(aTHX_ &ret, FUNC_NAME_TO_PTR(S_docatch_body));
+ CALLPROTECT(aTHX_ &ret, MEMBER_TO_FPTR(S_docatch_body));
switch (ret) {
case 0:
break;
diff --git a/scope.h b/scope.h
index 4a3a2ed69d..efaf589092 100644
--- a/scope.h
+++ b/scope.h
@@ -83,8 +83,7 @@
save_delete(SOFT_CAST(HV*)(h), SOFT_CAST(char*)(k), (I32)(l))
#define CALLDESTRUCTOR (*SSPOPDPTR)
#define SAVEDESTRUCTOR(f,p) \
- save_destructor((DESTRUCTORFUNC_t)(FUNC_NAME_TO_PTR(f)), \
- SOFT_CAST(void*)(p))
+ save_destructor((DESTRUCTORFUNC_t)(f), SOFT_CAST(void*)(p))
#define SAVESTACK_POS() \
STMT_START { \
diff --git a/sv.c b/sv.c
index 6392f54034..5b5a361ab6 100644
--- a/sv.c
+++ b/sv.c
@@ -294,17 +294,17 @@ S_visit(pTHX_ SVFUNC_t f)
void
Perl_sv_report_used(pTHX)
{
- visit(FUNC_NAME_TO_PTR(do_report_used));
+ visit(do_report_used);
}
void
Perl_sv_clean_objs(pTHX)
{
PL_in_clean_objs = TRUE;
- visit(FUNC_NAME_TO_PTR(do_clean_objs));
+ visit(do_clean_objs);
#ifndef DISABLE_DESTRUCTOR_KLUDGE
/* some barnacles may yet remain, clinging to typeglobs */
- visit(FUNC_NAME_TO_PTR(do_clean_named_objs));
+ visit(do_clean_named_objs);
#endif
PL_in_clean_objs = FALSE;
}
@@ -313,7 +313,7 @@ void
Perl_sv_clean_all(pTHX)
{
PL_in_clean_all = TRUE;
- visit(FUNC_NAME_TO_PTR(do_clean_all));
+ visit(do_clean_all);
PL_in_clean_all = FALSE;
}
diff --git a/thrdvar.h b/thrdvar.h
index b3f3be5994..f4d3ed428f 100644
--- a/thrdvar.h
+++ b/thrdvar.h
@@ -100,7 +100,7 @@ PERLVAR(Tmainstack, AV *) /* the stack when nothing funny is happening */
PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */
PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */
-PERLVARI(Tprotect, protect_proc_t, FUNC_NAME_TO_PTR(Perl_default_protect))
+PERLVARI(Tprotect, protect_proc_t, MEMBER_TO_FPTR(Perl_default_protect))
/* statics "owned" by various functions */
PERLVAR(Tav_fetch_sv, SV *) /* owned by av_fetch() */
@@ -173,15 +173,15 @@ PERLVARI(Treg_curpm, PMOP*, NULL) /* curpm during match */
PERLVAR(Treg_oldsaved, char*) /* old saved substr during match */
PERLVAR(Treg_oldsavedlen, STRLEN) /* old length of saved substr during match */
-PERLVARI(Tregcompp, regcomp_t, FUNC_NAME_TO_PTR(Perl_pregcomp))
+PERLVARI(Tregcompp, regcomp_t, MEMBER_TO_FPTR(Perl_pregcomp))
/* Pointer to REx compiler */
-PERLVARI(Tregexecp, regexec_t, FUNC_NAME_TO_PTR(Perl_regexec_flags))
+PERLVARI(Tregexecp, regexec_t, MEMBER_TO_FPTR(Perl_regexec_flags))
/* Pointer to REx executer */
-PERLVARI(Tregint_start, re_intuit_start_t, FUNC_NAME_TO_PTR(Perl_re_intuit_start))
+PERLVARI(Tregint_start, re_intuit_start_t, MEMBER_TO_FPTR(Perl_re_intuit_start))
/* Pointer to optimized REx executer */
-PERLVARI(Tregint_string,re_intuit_string_t, FUNC_NAME_TO_PTR(Perl_re_intuit_string))
+PERLVARI(Tregint_string,re_intuit_string_t, MEMBER_TO_FPTR(Perl_re_intuit_string))
/* Pointer to optimized REx string */
-PERLVARI(Tregfree, regfree_t, FUNC_NAME_TO_PTR(Perl_pregfree))
+PERLVARI(Tregfree, regfree_t, MEMBER_TO_FPTR(Perl_pregfree))
/* Pointer to REx free()er */
PERLVARI(Treginterp_cnt,int, 0) /* Whether `Regexp'
diff --git a/util.c b/util.c
index 960bdb5341..1ed48d2436 100644
--- a/util.c
+++ b/util.c
@@ -3233,7 +3233,7 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t)
Zero(thr, 1, struct perl_thread);
#endif
- PL_protect = FUNC_NAME_TO_PTR(Perl_default_protect);
+ PL_protect = MEMBER_TO_FPTR(Perl_default_protect);
thr->oursv = sv;
init_stacks();
@@ -3266,11 +3266,11 @@ Perl_new_struct_thread(pTHX_ struct perl_thread *t)
PL_statname = NEWSV(66,0);
PL_maxscream = -1;
- PL_regcompp = FUNC_NAME_TO_PTR(Perl_pregcomp);
- PL_regexecp = FUNC_NAME_TO_PTR(Perl_regexec_flags);
- PL_regint_start = FUNC_NAME_TO_PTR(Perl_re_intuit_start);
- PL_regint_string = FUNC_NAME_TO_PTR(Perl_re_intuit_string);
- PL_regfree = FUNC_NAME_TO_PTR(Perl_pregfree);
+ PL_regcompp = MEMBER_TO_FPTR(Perl_pregcomp);
+ PL_regexecp = MEMBER_TO_FPTR(Perl_regexec_flags);
+ PL_regint_start = MEMBER_TO_FPTR(Perl_re_intuit_start);
+ PL_regint_string = MEMBER_TO_FPTR(Perl_re_intuit_string);
+ PL_regfree = MEMBER_TO_FPTR(Perl_pregfree);
PL_regindent = 0;
PL_reginterp_cnt = 0;
PL_lastscream = Nullsv;
diff --git a/win32/Makefile b/win32/Makefile
index 3139be66a4..82a72ecc74 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -138,10 +138,7 @@ CCLIBDIR = $(CCHOME)\lib
# We don't enable this by default because we want the modules to get fixed
# instead of clinging to shortcuts like this one.
#
-# Don't enable -DPERL_IMPLICIT_CONTEXT if you don't know what it is. :-)
-#
#BUILDOPT = $(BUILDOPT) -DPERL_POLLUTE
-#BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
#
# specify semicolon-separated list of extra directories that modules will
@@ -186,6 +183,10 @@ USE_THREADS = undef
USE_MULTI = undef
!ENDIF
+!IF "$(USE_MULTI)$(USE_THREADS)$(USE_OBJECT)" != ""
+BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
+!ENDIF
+
!IF "$(PROCESSOR_ARCHITECTURE)" == ""
PROCESSOR_ARCHITECTURE = x86
!ENDIF
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 2289b915a4..ffda9fd6e8 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -153,10 +153,7 @@ CCLIBDIR *= $(CCHOME)\lib
# We don't enable this by default because we want the modules to get fixed
# instead of clinging to shortcuts like this one.
#
-# Don't enable -DPERL_IMPLICIT_CONTEXT if you don't know what it is. :-)
-#
#BUILDOPT += -DPERL_POLLUTE
-#BUILDOPT += -DPERL_IMPLICIT_CONTEXT
#
# specify semicolon-separated list of extra directories that modules will
@@ -174,7 +171,7 @@ EXTRALIBDIRS *=
# set this to your email address (perl will guess a value from
# from your loginname and your hostname, which may not be right)
#
-EMAIL *= support@activestate.com
+#EMAIL *=
##
## Build configuration ends.
@@ -200,6 +197,12 @@ PERL_MALLOC *= undef
USE_THREADS *= undef
USE_MULTI *= undef
+
+.IF "$(USE_MULTI)$(USE_THREADS)$(USE_OBJECT)" != ""
+BUILDOPT += -DPERL_IMPLICIT_CONTEXT
+.ENDIF
+
+
.IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
PROCESSOR_ARCHITECTURE *= x86
@@ -639,12 +642,7 @@ X2P_OBJ = $(X2P_SRC:db:+$(o))
PERLDLL_OBJ = $(CORE_OBJ)
PERLEXE_OBJ = perlmain$(o)
-.IF "$(USE_OBJECT)" != "define"
PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
-.ELSE
-PERLEXE_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
-PERL95_OBJ += DynaLoadmt$(o)
-.ENDIF
.IF "$(USE_SETARGV)" != ""
SETARGV_OBJ = setargv$(o)
diff --git a/win32/win32.c b/win32/win32.c
index a0115732a0..59e493ab7f 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -66,6 +66,11 @@
int _CRT_glob = 0;
#endif
+#ifdef __BORLANDC__
+# define _stat stat
+# define _utimbuf utimbuf
+#endif
+
#define EXECF_EXEC 1
#define EXECF_SPAWN 2
#define EXECF_SPAWN_NOWAIT 3
@@ -1551,9 +1556,9 @@ extern char * des_fcrypt(const char *txt, const char *salt, char *cbuf);
DllExport char *
win32_crypt(const char *txt, const char *salt)
{
+ dTHXo;
#ifdef HAVE_DES_FCRYPT
dTHR;
- dTHXo;
return des_fcrypt(txt, salt, crypt_buffer);
#else
die("The crypt() function is unimplemented due to excessive paranoia.");
diff --git a/win32/win32.h b/win32/win32.h
index 1110f7e18a..0ed53d6f47 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -182,7 +182,7 @@ struct utsname {
/* Borland is picky about a bare member function name used as its ptr */
#ifdef PERL_OBJECT
-#define FUNC_NAME_TO_PTR(name) &(name)
+# define MEMBER_TO_FPTR(name) &(name)
#endif
#endif
@@ -256,7 +256,7 @@ typedef long gid_t;
#define fcloseall _fcloseall
#ifdef PERL_OBJECT
-#define FUNC_NAME_TO_PTR(name) &(name)
+# define MEMBER_TO_FPTR(name) &(name)
#endif
#ifndef _O_NOINHERIT