summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-05-24 17:13:13 -0500
committerCraig A. Berry <craigberry@mac.com>2012-05-24 17:13:13 -0500
commit25bbd8263003a49c3f7afdc1cd082f6f66e76ce4 (patch)
treec8bd69cd71d0f5095fc9e90ce045107b75df879b
parent929df5ffc08c253ffd629a57e960a554868f4551 (diff)
downloadperl-25bbd8263003a49c3f7afdc1cd082f6f66e76ce4.tar.gz
File scope for VMS-specific #includes.
C++ requires #include directives to be at file scope, but we've been lazy and haven't been doing that.
-rw-r--r--doio.c5
-rw-r--r--mg.c7
-rw-r--r--perl.c5
-rw-r--r--perlio.c5
-rw-r--r--util.c5
5 files changed, 21 insertions, 6 deletions
diff --git a/doio.c b/doio.c
index c2b110202b..a430361eaf 100644
--- a/doio.c
+++ b/doio.c
@@ -1562,6 +1562,10 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
#endif /* OS2 || WIN32 */
+#ifdef VMS
+#include <starlet.h> /* for sys$delprc */
+#endif
+
I32
Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
{
@@ -1698,7 +1702,6 @@ nothing in the core.
/* kill() doesn't do process groups (job trees?) under VMS */
if (val < 0) val = -val;
if (val == SIGKILL) {
-# include <starlet.h>
/* Use native sys$delprc() to insure that target process is
* deleted; supervisor-mode images don't pay attention to
* CRTL's emulation of Unix-style signals and kill()
diff --git a/mg.c b/mg.c
index 74e320ea39..e0aea0f44a 100644
--- a/mg.c
+++ b/mg.c
@@ -789,6 +789,11 @@ Perl_emulate_cop_io(pTHX_ const COP *const c, SV *const sv)
}
}
+#ifdef VMS
+#include <descrip.h>
+#include <starlet.h>
+#endif
+
int
Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
{
@@ -823,8 +828,6 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
if (nextchar == '\0') {
#if defined(VMS)
{
-# include <descrip.h>
-# include <starlet.h>
char msg[255];
$DESCRIPTOR(msgdsc,msg);
sv_setnv(sv,(NV) vaxc$errno);
diff --git a/perl.c b/perl.c
index 7f6848e48e..afb94e84e2 100644
--- a/perl.c
+++ b/perl.c
@@ -3506,6 +3506,10 @@ Internet, point your browser at http://www.perl.org/, the Perl Home Page.\n\n");
/* unexec() can be found in the Gnu emacs distribution */
/* Known to work with -DUNEXEC and using unexelf.c from GNU emacs-20.2 */
+#ifdef VMS
+#include <lib$routines.h>
+#endif
+
void
Perl_my_unexec(pTHX)
{
@@ -3524,7 +3528,6 @@ Perl_my_unexec(pTHX)
PerlProc_exit(status);
#else
# ifdef VMS
-# include <lib$routines.h>
lib$signal(SS$_DEBUG); /* ssdef.h #included from vmsish.h */
# elif defined(WIN32) || defined(__CYGWIN__)
Perl_croak(aTHX_ "dump is not supported");
diff --git a/perlio.c b/perlio.c
index 7782728f61..7dac9be33b 100644
--- a/perlio.c
+++ b/perlio.c
@@ -70,6 +70,10 @@
int mkstemp(char*);
#endif
+#ifdef VMS
+#include <rms.h>
+#endif
+
#define PerlIO_lockcnt(f) (((PerlIOl*)(f))->head->flags)
/* Call the callback or PerlIOBase, and return failure. */
@@ -3895,7 +3899,6 @@ PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers,
PerlLIO_setmode(fd, O_BINARY);
#endif
#ifdef VMS
-#include <rms.h>
/* Enable line buffering with record-oriented regular files
* so we don't introduce an extraneous record boundary when
* the buffer fills up.
diff --git a/util.c b/util.c
index 171456f3c2..378ffe05bf 100644
--- a/util.c
+++ b/util.c
@@ -5727,6 +5727,10 @@ Perl_parse_unicode_opts(pTHX_ const char **popt)
return opt;
}
+#ifdef VMS
+# include <starlet.h>
+#endif
+
U32
Perl_seed(pTHX)
{
@@ -5758,7 +5762,6 @@ Perl_seed(pTHX)
#endif
U32 u;
#ifdef VMS
-# include <starlet.h>
/* when[] = (low 32 bits, high 32 bits) of time since epoch
* in 100-ns units, typically incremented ever 10 ms. */
unsigned int when[2];