From: Jarkko Hietaniemi Date: Thu, 14 Jun 2007 22:32:49 +0000 (-0400) Subject: miscellanea X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cef6ea9dde586d23f429802e75d22875450d6b68;p=p5sagit%2Fp5-mst-13.2.git miscellanea Message-ID: <4671FA51.4070001@iki.fi> p4raw-id: //depot/perl@31388 --- diff --git a/Makefile.SH b/Makefile.SH index 9b9920e..ffec2a8 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -242,6 +242,9 @@ STATIC = $static_target # the dynamic loader path you are building a shared libperl. LDLIBPTH = $ldlibpth +# Sometimes running an executable is an adventure. +RUN = $run + dynamic_ext = $dynamic_list static_ext = $static_list nonxs_ext = $nonxs_list @@ -631,7 +634,7 @@ miniperl: $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT) $(CC) -o miniperl $(CLDFLAGS) \ `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \ miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs) - $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '' || $(MAKE) minitest + $(LDLIBPTH) $(RUN) ./miniperl -w -Ilib -MExporter -e '' || $(MAKE) minitest !NO!SUBS! ;; next4*) @@ -639,7 +642,7 @@ miniperl: $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT) miniperl: $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT) $(CC) -o miniperl `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \ miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs) - $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '' || $(MAKE) minitest + $(LDLIBPTH) $(RUN) ./miniperl -w -Ilib -MExporter -e '' || $(MAKE) minitest !NO!SUBS! ;; darwin*) @@ -661,7 +664,7 @@ miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT) $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o miniperl \ `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \ miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs) - $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '' || $(MAKE) minitest + $(LDLIBPTH) $(RUN) ./miniperl -w -Ilib -MExporter -e '' || $(MAKE) minitest !NO!SUBS! ;; *) @@ -671,7 +674,7 @@ miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(obj) opmini$(OBJ_EXT) $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl \ `echo $(obj) | sed 's/ op$(OBJ_EXT) / /'` \ miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(libs) - $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '' || $(MAKE) minitest + $(LDLIBPTH) $(RUN) ./miniperl -w -Ilib -MExporter -e '' || $(MAKE) minitest !NO!SUBS! ;; esac @@ -811,23 +814,23 @@ sperl$(OBJ_EXT): perl.c $(h) preplibrary: miniperl$(EXE_EXT) $(CONFIGPM) lib/lib.pm $(PREPLIBRARY_LIBPERL) @sh ./makedir lib/auto @echo " AutoSplitting perl library" - $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \ + $(LDLIBPTH) $(RUN) ./miniperl -Ilib -e 'use AutoSplit; \ autosplit_lib_modules(@ARGV)' lib/*.pm - $(LDLIBPTH) ./miniperl -Ilib -e 'use AutoSplit; \ + $(LDLIBPTH) $(RUN) ./miniperl -Ilib -e 'use AutoSplit; \ autosplit_lib_modules(@ARGV)' lib/*/*.pm $(MAKE) lib/re.pm .PHONY: makeppport makeppport: miniperl$(EXE_EXT) $(CONFIGPM) - $(LDLIBPTH) ./miniperl$(EXE_EXT) -Ilib mkppport + $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib mkppport lib/Config.pod: config.sh miniperl$(EXE_EXT) configpm Porting/Glossary - $(LDLIBPTH) ./miniperl -Ilib configpm + $(LDLIBPTH) $(RUN) ./miniperl -Ilib configpm $(CONFIGPM): lib/Config.pod lib/ExtUtils/Miniperl.pm: miniperlmain.c miniperl$(EXE_EXT) minimod.pl $(CONFIGPM) - $(LDLIBPTH) ./miniperl minimod.pl > lib/ExtUtils/Miniperl.pm + $(LDLIBPTH) $(RUN) ./miniperl minimod.pl > lib/ExtUtils/Miniperl.pm lib/re.pm: ext/re/re.pm @-rm -f $@ @@ -835,19 +838,19 @@ lib/re.pm: ext/re/re.pm $(plextract): miniperl$(EXE_EXT) $(CONFIGPM) x2p/s2p @-rm -f $@ - $(LDLIBPTH) ./miniperl -I`pwd`/lib $@.PL + $(LDLIBPTH) $(RUN) ./miniperl -I`pwd`/lib $@.PL x2p/s2p: miniperl$(EXE_EXT) $(CONFIGPM) x2p/s2p.PL cd x2p; $(LDLIBPTH) $(MAKE) s2p lib/lib.pm: miniperl$(EXE_EXT) $(CONFIGPM) @-rm -f $@ - $(LDLIBPTH) ./miniperl -Ilib lib/lib_pm.PL + $(LDLIBPTH) $(RUN) ./miniperl -Ilib lib/lib_pm.PL unidatafiles $(unidatafiles): uni.data uni.data: miniperl$(EXE_EXT) $(CONFIGPM) lib/unicore/mktables - cd lib/unicore && $(LDLIBPTH) ../../miniperl -I../../lib mktables -w + cd lib/unicore && $(LDLIBPTH) $(RUN) ../../miniperl -I../../lib mktables -w touch uni.data extra.pods: miniperl$(EXE_EXT) @@ -876,7 +879,7 @@ extras.install: perl$(EXE_EXT) no-install install.perl install.man install.html META.yml: Porting/makemeta Porting/Maintainers.pl Porting/Maintainers.pm - $(LDLIBPTH) ./miniperl -Ilib Porting/makemeta + $(LDLIBPTH) $(RUN) ./miniperl -Ilib Porting/makemeta install-strip: $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)" @@ -1079,7 +1082,7 @@ _cleaner1: -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \ $(LDLIBPTH) sh ext/util/make_ext $(CLEAN) $$x MAKE=$(MAKE) ; \ done - -@test ! -f ./miniperl$(EXE_EXT) || $(LDLIBPTH) ./miniperl$(EXE_EXT) -Ilib mkppport --clean + -@test ! -f $(RUN) ./miniperl$(EXE_EXT) || $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib mkppport --clean # Some systems do not support "?", so keep these files separate. _cleaner2: @@ -1177,10 +1180,10 @@ _test_notty: cd t && $(PERL_DEBUG) PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) $(PERL) $(TESTFILE) $(TEST_ARGS) unpack_files: - $(LDLIBPTH) ./miniperl$(EXE_EXT) -Ilib uupacktool.pl -u -m + $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib uupacktool.pl -u -m cleanup_unpacked_files: - -@test ! -f ./miniperl$(EXE_EXT) || $(LDLIBPTH) ./miniperl$(EXE_EXT) -Ilib uupacktool.pl -c + -@test ! -f $(RUN) ./miniperl$(EXE_EXT) || $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib uupacktool.pl -c # The second branch is for testing without a tty or controlling terminal, # see t/op/stat.t diff --git a/embed.fnc b/embed.fnc index d282647..ef1d961 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1101,8 +1101,8 @@ Ap |void |sys_intern_clear Ap |void |sys_intern_init #endif -ApR |char * |custom_op_name |NN const OP* op -ApR |char * |custom_op_desc |NN const OP* op +ApR |const char * |custom_op_name |NN const OP* op +ApR |const char * |custom_op_desc |NN const OP* op Adp |void |sv_nosharing |NULLOK SV *sv Adpbm |void |sv_nolocking |NULLOK SV *sv diff --git a/hv.h b/hv.h index 1aaee59..f8e38a1 100644 --- a/hv.h +++ b/hv.h @@ -259,7 +259,7 @@ C. #define HvRITER_set(hv,r) Perl_hv_riter_set(aTHX_ (HV*)(hv), r) #define HvEITER_set(hv,e) Perl_hv_eiter_set(aTHX_ (HV*)(hv), e) #define HvRITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_riter : -1) -#define HvEITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_eiter : 0) +#define HvEITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_eiter : NULL) #define HvNAME(hv) HvNAME_get(hv) /* Checking that hv is a valid package stash is the @@ -271,9 +271,9 @@ C. /* FIXME - all of these should use a UTF8 aware API, which should also involve getting the length. */ /* This macro may go away without notice. */ -#define HvNAME_HEK(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_name : 0) +#define HvNAME_HEK(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_name : NULL) #define HvNAME_get(hv) ((SvOOK(hv) && (HvAUX(hv)->xhv_name)) \ - ? HEK_KEY(HvAUX(hv)->xhv_name) : 0) + ? HEK_KEY(HvAUX(hv)->xhv_name) : NULL) #define HvNAMELEN_get(hv) ((SvOOK(hv) && (HvAUX(hv)->xhv_name)) \ ? HEK_LEN(HvAUX(hv)->xhv_name) : 0) diff --git a/op.c b/op.c index d29b36d..731dce4 100644 --- a/op.c +++ b/op.c @@ -8404,7 +8404,7 @@ Perl_peep(pTHX_ register OP *o) LEAVE; } -char* +const char* Perl_custom_op_name(pTHX_ const OP* o) { dVAR; @@ -8424,7 +8424,7 @@ Perl_custom_op_name(pTHX_ const OP* o) return SvPV_nolen(HeVAL(he)); } -char* +const char* Perl_custom_op_desc(pTHX_ const OP* o) { dVAR; diff --git a/proto.h b/proto.h index 613fa85..2f8e2eb 100644 --- a/proto.h +++ b/proto.h @@ -2957,11 +2957,11 @@ PERL_CALLCONV void Perl_sys_intern_clear(pTHX); PERL_CALLCONV void Perl_sys_intern_init(pTHX); #endif -PERL_CALLCONV char * Perl_custom_op_name(pTHX_ const OP* op) +PERL_CALLCONV const char * Perl_custom_op_name(pTHX_ const OP* op) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); -PERL_CALLCONV char * Perl_custom_op_desc(pTHX_ const OP* op) +PERL_CALLCONV const char * Perl_custom_op_desc(pTHX_ const OP* op) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); diff --git a/sv.c b/sv.c index 4be849f..02b4d02 100644 --- a/sv.c +++ b/sv.c @@ -467,7 +467,7 @@ do_clean_named_objs(pTHX_ SV *sv) SvOBJECT(GvSV(sv))) || (GvAV(sv) && SvOBJECT(GvAV(sv))) || (GvHV(sv) && SvOBJECT(GvHV(sv))) || - (GvIO(sv) && SvOBJECT(GvIO(sv))) || + (GvIO(sv) && GvIOp(sv) && SvOBJECT(GvIO(sv))) || /* In certain rare cases GvIOP(sv) can be NULL, which would make SvOBJECT(GvIO(sv)) dereference NULL. */ (GvCV(sv) && SvOBJECT(GvCV(sv))) ) { DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning named glob object:\n "), sv_dump(sv))); diff --git a/util.c b/util.c index afa5de9..e8a5039 100644 --- a/util.c +++ b/util.c @@ -1909,7 +1909,10 @@ Perl_my_htonl(pTHX_ long l) char c[sizeof(long)]; } u; -#if BYTEORDER == 0x1234 +#if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678 +#if BYTEORDER == 0x12345678 + u.result = 0; +#endif u.c[0] = (l >> 24) & 255; u.c[1] = (l >> 16) & 255; u.c[2] = (l >> 8) & 255; @@ -2508,7 +2511,7 @@ Perl_my_popen(pTHX_ const char *cmd, const char *mode) #if defined(atarist) || defined(EPOC) FILE *popen(); PerlIO * -Perl_my_popen((pTHX_ const char *cmd, const char *mode) +Perl_my_popen(pTHX_ const char *cmd, const char *mode) { PERL_FLUSHALL_FOR_CHILD; /* Call system's popen() to get a FILE *, then import it. @@ -2521,7 +2524,7 @@ Perl_my_popen((pTHX_ const char *cmd, const char *mode) #if defined(DJGPP) FILE *djgpp_popen(); PerlIO * -Perl_my_popen((pTHX_ const char *cmd, const char *mode) +Perl_my_popen(pTHX_ const char *cmd, const char *mode) { PERL_FLUSHALL_FOR_CHILD; /* Call system's popen() to get a FILE *, then import it.