aboutsummaryrefslogtreecommitdiffstats
path: root/extension
diff options
context:
space:
mode:
Diffstat (limited to 'extension')
-rw-r--r--extension/ChangeLog6
-rw-r--r--extension/filefuncs.c27
-rw-r--r--extension/fnmatch.c14
-rw-r--r--extension/gawkdirfd.h4
4 files changed, 51 insertions, 0 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 328d58ba..c0e1fbb0 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,9 @@
+2013-12-29 John E. Malmberg <wb8tyw@qsl.net>
+
+ * gawkdirfd.h: Adjust include for VMS.
+ * filefuncs.c: Make it compile on VMS.
+ * fnmatch.c: Make it compile on VMS.
+
2013-12-21 Mike Frysinger <vapier@gentoo.org>
* configure.ac: Remove MirBSD and OS/390 hack to create
diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index 61cadfec..a6e99e8e 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -36,6 +36,33 @@
#define _BSD_SOURCE
+#ifdef __VMS
+#if (__CRTL_VER >= 70200000) && !defined (__VAX)
+#define _LARGEFILE 1
+#endif
+
+#ifndef __VAX
+#ifdef __CRTL_VER
+#if __CRTL_VER >= 80200000
+#define _USE_STD_STAT 1
+#endif
+#endif
+#endif
+#define _POSIX_C_SOURCE 1
+#define _XOPEN_SOURCE 1
+#include <stat.h>
+#ifndef S_ISVTX
+#define S_ISVTX (0)
+#endif
+#ifndef major
+#define major(s) (s)
+#endif
+#ifndef minor
+#define minor(s) (0)
+#endif
+#endif
+
+
#include <stdio.h>
#include <assert.h>
#include <errno.h>
diff --git a/extension/fnmatch.c b/extension/fnmatch.c
index a67bc25f..a85bcc78 100644
--- a/extension/fnmatch.c
+++ b/extension/fnmatch.c
@@ -45,15 +45,29 @@
#define _(msgid) gettext(msgid)
#define N_(msgid) msgid
+#ifdef __VMS
+#define __iswctype iswctype
+#define __btowc btowc
+#endif
+
#define _GNU_SOURCE 1 /* use GNU extensions if they're there */
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h>
#else
+#ifdef __VMS
+#include "fnmatch.h" /* version that comes with gawk */
+#else
#include "../missing_d/fnmatch.h" /* version that comes with gawk */
#endif
+#define HAVE_FNMATCH_H
+#endif
#ifndef HAVE_FNMATCH
+#ifdef __VMS
+#include "fnmatch.c" /* ditto */
+#else
#include "../missing_d/fnmatch.c" /* ditto */
+#endif
#define HAVE_FNMATCH
#endif
diff --git a/extension/gawkdirfd.h b/extension/gawkdirfd.h
index a3a2b6a6..d1edf65f 100644
--- a/extension/gawkdirfd.h
+++ b/extension/gawkdirfd.h
@@ -35,7 +35,11 @@
* Unlike the main gawk code base, this include is NOT dependant
* upon MinGW or EMX.
*/
+#ifndef __VMS
#include "../nonposix.h"
+#else
+#include "nonposix.h"
+#endif
#ifndef DIR_TO_FD
# define DIR_TO_FD(d) (FAKE_FD_VALUE)