summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2023-01-15 18:04:36 -0500
committerPaul Smith <psmith@gnu.org>2023-01-15 18:04:36 -0500
commitceb52b5d1b10ce0f5a1ab090e1911cdde6f7d98a (patch)
tree393f7ba17b97fd53cc0933fd3d0203583553adcf
parentd4692df20de2db10c186d981ee04ce20487a79c3 (diff)
downloadmake-git-ceb52b5d1b10ce0f5a1ab090e1911cdde6f7d98a.tar.gz
Rename VMS macro to MK_OS_VMS
* src/makeint.h: Set MK_OS_VMS to 1 if we're on VMS. * src/*: Convert all #if references to VMS, to use MK_OS_VMS. * gl/lib/*: Ditto.
-rw-r--r--gl/lib/glob.c18
-rw-r--r--gl/lib/glob.in.h4
-rw-r--r--src/ar.c14
-rw-r--r--src/arscan.c12
-rw-r--r--src/commands.c2
-rw-r--r--src/config.h-vms2
-rw-r--r--src/default.c22
-rw-r--r--src/dep.h2
-rw-r--r--src/dir.c54
-rw-r--r--src/file.c10
-rw-r--r--src/function.c16
-rw-r--r--src/getopt.c2
-rw-r--r--src/implicit.c4
-rw-r--r--src/job.c48
-rw-r--r--src/job.h2
-rw-r--r--src/main.c20
-rw-r--r--src/makeint.h19
-rw-r--r--src/misc.c4
-rw-r--r--src/os.h4
-rw-r--r--src/read.c20
-rw-r--r--src/remake.c4
-rw-r--r--src/rule.c4
-rw-r--r--src/variable.c6
-rw-r--r--src/vmsify.c2
-rw-r--r--src/vpath.c8
25 files changed, 152 insertions, 151 deletions
diff --git a/gl/lib/glob.c b/gl/lib/glob.c
index 271a2d1c..a18c8942 100644
--- a/gl/lib/glob.c
+++ b/gl/lib/glob.c
@@ -71,7 +71,7 @@ USA. */
# endif
#endif
-#if !defined _AMIGA && !defined VMS && !defined WINDOWS32
+#if !defined _AMIGA && !MK_OS_VMS && !defined WINDOWS32
# include <pwd.h>
#endif
@@ -518,13 +518,13 @@ glob (const char *pattern, int flags,
oldcount = pglob->gl_pathc;
-#ifndef VMS
+#if !MK_OS_VMS
if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
{
if (dirname[1] == '\0' || dirname[1] == '/')
{
/* Look up home directory. */
-#ifdef VMS
+#if MK_OS_VMS
/* This isn't obvious, RTLs of DECC and VAXC know about "HOME" */
const char *home_dir = getenv ("SYS$LOGIN");
#else
@@ -538,7 +538,7 @@ glob (const char *pattern, int flags,
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "c:/users/default"; /* poor default */
# else
-# ifdef VMS
+# if MK_OS_VMS
/* Again, this isn't obvious, if "HOME" isn't known "SYS$LOGIN" should be set */
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "SYS$DISK:[]";
@@ -601,7 +601,7 @@ glob (const char *pattern, int flags,
else
home_dir = "~"; /* No luck. */
}
-# endif /* VMS */
+# endif /* MK_OS_VMS */
# endif /* WINDOWS32 */
# endif
/* Now construct the full directory. */
@@ -622,7 +622,7 @@ glob (const char *pattern, int flags,
dirname = newp;
}
}
-# if !defined _AMIGA && !defined WINDOWS32 && !defined VMS
+# if !defined _AMIGA && !defined WINDOWS32 && !MK_OS_VMS
else
{
char *end_name = strchr (dirname, '/');
@@ -702,9 +702,9 @@ glob (const char *pattern, int flags,
home directory. */
return GLOB_NOMATCH;
}
-# endif /* Not Amiga && not WINDOWS32 && not VMS. */
+# endif /* Not Amiga && not WINDOWS32 && not MK_OS_VMS. */
}
-#endif /* Not VMS. */
+#endif /* Not MK_OS_VMS. */
/* Now test whether we looked for "~" or "~NAME". In this case we
can give the answer now. */
@@ -1124,7 +1124,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
int meta;
int save;
-#ifdef VMS
+#if MK_OS_VMS
if (*directory == 0)
directory = "[]";
#endif
diff --git a/gl/lib/glob.in.h b/gl/lib/glob.in.h
index 5633d8b7..44a66556 100644
--- a/gl/lib/glob.in.h
+++ b/gl/lib/glob.in.h
@@ -67,7 +67,7 @@ extern "C" {
#endif
/* Structure describing a globbing run. */
-#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
+#if !defined _AMIGA && !MK_OS_VMS /* Buggy compiler. */
struct stat;
#endif
typedef struct
@@ -83,7 +83,7 @@ typedef struct
struct dirent *(*gl_readdir) (void *);
void * (*gl_opendir) (const char *);
int (*gl_lstat) (const char *, struct stat *);
-#if defined(VMS) && defined(__DECC) && !defined(_POSIX_C_SOURCE)
+#if MK_OS_VMS && defined(__DECC) && !defined(_POSIX_C_SOURCE)
int (*gl_stat) (const char *, struct stat *, ...);
#else
int (*gl_stat) (const char *, struct stat *);
diff --git a/src/ar.c b/src/ar.c
index 73fc0956..e6eb0a1e 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -120,7 +120,7 @@ ar_member_date (const char *name)
/* Set the archive-member NAME's modtime to now. */
-#ifdef VMS
+#if MK_OS_VMS
int
ar_touch (const char *name)
{
@@ -172,7 +172,7 @@ ar_touch (const char *name)
return val;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
/* State of an 'ar_glob' run, passed to 'ar_glob_match'. */
@@ -187,7 +187,7 @@ struct ar_glob_state
{
const char *arname;
const char *pattern;
-#ifdef VMS
+#if MK_OS_VMS
char *suffix;
#endif
size_t size;
@@ -210,7 +210,7 @@ ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
{
/* We have a match. Add it to the chain. */
struct nameseq *new = xcalloc (state->size);
-#ifdef VMS
+#if MK_OS_VMS
if (state->suffix)
new->name = strcache_add(
concat(5, state->arname, "(", mem, state->suffix, ")"));
@@ -268,7 +268,7 @@ ar_glob (const char *arname, const char *member_pattern, size_t size)
struct nameseq *n;
const char **names;
unsigned int i;
-#ifdef VMS
+#if MK_OS_VMS
char *vms_member_pattern;
#endif
if (! ar_glob_pattern_p (member_pattern, 1))
@@ -278,7 +278,7 @@ ar_glob (const char *arname, const char *member_pattern, size_t size)
ar_glob_match will accumulate them in STATE.chain. */
state.arname = arname;
state.pattern = member_pattern;
-#ifdef VMS
+#if MK_OS_VMS
{
/* In a copy of the pattern, find the suffix, save it and remove it from
the pattern */
@@ -299,7 +299,7 @@ ar_glob (const char *arname, const char *member_pattern, size_t size)
state.n = 0;
ar_scan (arname, ar_glob_match, &state);
-#ifdef VMS
+#if MK_OS_VMS
/* Deallocate any duplicated string */
free(vms_member_pattern);
if (state.suffix)
diff --git a/src/arscan.c b/src/arscan.c
index edd4070c..89f0e3b6 100644
--- a/src/arscan.c
+++ b/src/arscan.c
@@ -29,7 +29,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef NO_ARCHIVES
-#ifdef VMS
+#if MK_OS_VMS
#include <lbrdef.h>
#include <mhddef.h>
#include <credef.h>
@@ -289,7 +289,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *varg)
return -2;
}
-#else /* !VMS */
+#else /* !MK_OS_VMS */
/* SCO Unix's compiler defines both of these. */
#ifdef M_UNIX
@@ -841,7 +841,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
close (desc);
return -2;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
/* Return nonzero iff NAME matches MEM.
If TRUNCATED is nonzero, MEM may be truncated to
@@ -856,7 +856,7 @@ ar_name_equal (const char *name, const char *mem, int truncated)
if (p != 0)
name = p + 1;
-#ifndef VMS
+#if !MK_OS_VMS
if (truncated)
{
#ifdef AIAMAG
@@ -896,10 +896,10 @@ ar_name_equal (const char *name, const char *mem, int truncated)
match = !strcasecmp (name, mem);
return match;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
}
-#ifndef VMS
+#if !MK_OS_VMS
/* ARGSUSED */
static intmax_t
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
diff --git a/src/commands.c b/src/commands.c
index 49fa27de..e95e0262 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -26,7 +26,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
#include "w32err.h"
#endif
-#if VMS
+#if MK_OS_VMS
# define FILE_LIST_SEPARATOR (vms_comma_separator ? ',' : ' ')
#else
# define FILE_LIST_SEPARATOR ' '
diff --git a/src/config.h-vms b/src/config.h-vms
index 0aeffd6b..6d733c13 100644
--- a/src/config.h-vms
+++ b/src/config.h-vms
@@ -17,7 +17,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
#include "mkconfig.h"
-#define MK_VMS 1
+#define MK_OS_VMS 1
/* Pull in types.h here to get __CRTL_VER defined for old versions of the
compiler which don't define it. */
diff --git a/src/default.c b/src/default.c
index 3d81ff05..db132f78 100644
--- a/src/default.c
+++ b/src/default.c
@@ -37,7 +37,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
a '.c' or '.p' or ... file rather than from a .s file. */
static char default_suffixes[]
-#ifdef VMS
+#if MK_OS_VMS
/* VMS should include all UNIX/POSIX + some VMS extensions */
= ".out .exe .a .olb .hlb .tlb .mlb .ln .o .obj .c .cxx .cc .cpp .pas .p \
.for .f .r .y .l .ym .yl .mar .s .ss .i .ii .mod .sym .def .h .info .dvi \
@@ -55,7 +55,7 @@ static char default_suffixes[]
static struct pspec default_pattern_rules[] =
{
-#ifdef VMS
+#if MK_OS_VMS
{ "(%)", "%",
"@if f$$search(\"$@\") .eqs. \"\" then $(LIBRARY)/CREATE/"
"$(or "
@@ -76,7 +76,7 @@ static struct pspec default_pattern_rules[] =
/* The X.out rules are only in BSD's default set because
BSD Make has no null-suffix rules, so 'foo.out' and
'foo' are the same thing. */
-#ifdef VMS
+#if MK_OS_VMS
{ "%.exe", "%",
"$(CP) $< $@" },
@@ -95,7 +95,7 @@ static struct pspec default_pattern_rules[] =
static struct pspec default_terminal_rules[] =
{
-#ifdef VMS
+#if MK_OS_VMS
/* RCS. */
{ "%", "%$$5lv", /* Multinet style */
@@ -124,13 +124,13 @@ static struct pspec default_terminal_rules[] =
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
{ "%", "SCCS/s.%",
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
{ 0, 0, 0 }
};
static const char *default_suffix_rules[] =
{
-#ifdef VMS
+#if MK_OS_VMS
".o",
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".obj",
@@ -263,7 +263,7 @@ static const char *default_suffix_rules[] =
".l.ln",
"@$(RM) $*.c\n $(LEX.l) $< > $*.c\n$(LINT.c) -i $*.c -o $@\n $(RM) $*.c",
-#else /* ! VMS */
+#else /* ! MK_OS_VMS */
".o",
"$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@",
@@ -393,14 +393,14 @@ static const char *default_suffix_rules[] =
".web.tex",
"$(WEAVE) $<",
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
0, 0,
};
static const char *default_variables[] =
{
-#ifdef VMS
+#if MK_OS_VMS
#ifdef __ALPHA
"ARCH", "ALPHA",
#endif
@@ -515,7 +515,7 @@ static const char *default_variables[] =
"CP", "copy",
".LIBPATTERNS", "%.olb lib%.a",
-#else /* !VMS */
+#else /* !MK_OS_VMS */
"AR", "ar",
#ifdef _AIX
@@ -670,7 +670,7 @@ static const char *default_variables[] =
".LIBPATTERNS", "lib%.so lib%.a",
#endif
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
/* Make this assignment to avoid undefined variable warnings. */
GNUMAKEFLAGS_NAME, "",
0, 0
diff --git a/src/dep.h b/src/dep.h
index 7157d459..bfb1b5e5 100644
--- a/src/dep.h
+++ b/src/dep.h
@@ -89,7 +89,7 @@ struct goaldep
#define PARSE_SIMPLE_SEQ(_s,_t) \
(_t *)parse_file_seq ((_s),sizeof (_t),MAP_NUL,NULL,PARSEFS_NONE)
-#ifdef VMS
+#if MK_OS_VMS
void *parse_file_seq ();
#else
void *parse_file_seq (char **stringp, size_t size,
diff --git a/src/dir.c b/src/dir.c
index 9c5fa0a9..5abafae9 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -23,7 +23,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
#ifdef HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
-# ifdef VMS
+# if MK_OS_VMS
/* its prototype is in vmsdir.h, which is not needed for HAVE_DIRENT_H */
const char *vmsify (const char *name, int type);
# endif
@@ -50,7 +50,7 @@ const char *vmsify (const char *name, int type);
# define NAMLEN(d) _D_NAMLEN(d)
#endif
-#if (defined (POSIX) || defined (VMS) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
+#if (defined (POSIX) || MK_OS_VMS || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
# define REAL_DIR_ENTRY(dp) 1
@@ -137,7 +137,7 @@ downcase (const char *filename)
}
#endif /* HAVE_CASE_INSENSITIVE_FS */
-#ifdef VMS
+#if MK_OS_VMS
static char *
downcase_inplace(char *filename)
@@ -227,7 +227,7 @@ vmsstat_dir (const char *name, struct stat *st)
# define stat(__path, __sbuf) vmsstat_dir (__path, __sbuf)
#endif /* _USE_STD_STAT */
-#endif /* VMS */
+#endif /* MK_OS_VMS */
/* Never have more than this many directories open at once. */
@@ -258,7 +258,7 @@ struct directory_contents
# define FS_NTFS 0x2
# define FS_UNKNOWN 0x4
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
ino_t ino[3];
# else
ino_t ino;
@@ -296,7 +296,7 @@ directory_contents_hash_1 (const void *key_0)
ISTRING_HASH_1 (key->path_key, hash);
hash ^= ((unsigned int) key->dev << 4) ^ (unsigned int) key->ctime;
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
hash = (((unsigned int) key->dev << 4)
^ ((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
@@ -319,7 +319,7 @@ directory_contents_hash_2 (const void *key_0)
ISTRING_HASH_2 (key->path_key, hash);
hash ^= ((unsigned int) key->dev << 4) ^ (unsigned int) ~key->ctime;
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
hash = (((unsigned int) key->dev << 4)
^ ~((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
@@ -358,7 +358,7 @@ directory_contents_hash_cmp (const void *xv, const void *yv)
if (result)
return result;
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
result = MAKECMP(x->ino[0], y->ino[0]);
if (result)
return result;
@@ -499,7 +499,7 @@ find_directory (const char *name)
size_t len = strlen (name);
dir = xmalloc (sizeof (struct directory));
-#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+#if defined(HAVE_CASE_INSENSITIVE_FS) && MK_OS_VMS
/* Todo: Why is this only needed on VMS? */
{
char *lname = downcase_inplace (xstrdup (name));
@@ -548,7 +548,7 @@ find_directory (const char *name)
dc_key.path_key = w32_path = w32ify (name, 1);
dc_key.ctime = st.st_ctime;
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
dc_key.ino[0] = st.st_ino[0];
dc_key.ino[1] = st.st_ino[1];
dc_key.ino[2] = st.st_ino[2];
@@ -734,7 +734,7 @@ dir_contents_file_exists_p (struct directory *dir,
break;
}
-#if defined(VMS) && defined(HAVE_DIRENT_H)
+#if MK_OS_VMS && defined(HAVE_DIRENT_H)
/* In VMS we get file versions too, which have to be stripped off.
Some versions of VMS return versions on Unix files even when
the feature option to strip them is set. */
@@ -760,7 +760,7 @@ dir_contents_file_exists_p (struct directory *dir,
#endif
{
df = xmalloc (sizeof (struct dirfile));
-#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+#if MK_OS_VMS && defined(HAVE_CASE_INSENSITIVE_FS)
/* TODO: Why is this only needed on VMS? */
df->name = strcache_add_len (downcase_inplace (d->d_name), len);
#else
@@ -797,7 +797,7 @@ dir_contents_file_exists_p (struct directory *dir,
int
dir_file_exists_p (const char *dirname, const char *filename)
{
-#ifdef VMS
+#if MK_OS_VMS
if (filename && dirname && strpbrk (dirname, ":<[") != NULL)
filename = vmsify (filename, 0);
#endif
@@ -820,7 +820,7 @@ file_exists_p (const char *name)
#endif
dirend = strrchr (name, '/');
-#ifdef VMS
+#if MK_OS_VMS
if (dirend == NULL)
{
dirend = strrchr (name, ']');
@@ -836,7 +836,7 @@ file_exists_p (const char *name)
dirend = strrchr (name, ':');
dirend == NULL ? dirend : dirend++;
}
-#endif /* VMS */
+#endif /* MK_OS_VMS */
#ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
@@ -868,7 +868,7 @@ file_exists_p (const char *name)
p[dirend - name] = '\0';
dirname = p;
}
-#ifdef VMS
+#if MK_OS_VMS
if (*slash == '/')
slash++;
#else
@@ -890,7 +890,7 @@ file_impossible (const char *filename)
struct dirfile *new;
dirend = strrchr (p, '/');
-#ifdef VMS
+#if MK_OS_VMS
if (dirend == NULL)
{
dirend = strrchr (p, ']');
@@ -941,7 +941,7 @@ file_impossible (const char *filename)
dirname = cp;
}
dir = find_directory (dirname);
-#ifdef VMS
+#if MK_OS_VMS
if (*slash == '/')
filename = p = slash + 1;
else
@@ -964,7 +964,7 @@ file_impossible (const char *filename)
new = xmalloc (sizeof (struct dirfile));
new->length = strlen (filename);
-#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+#if defined(HAVE_CASE_INSENSITIVE_FS) && MK_OS_VMS
/* todo: Why is this only needed on VMS? */
new->name = strcache_add_len (downcase (filename), new->length);
#else
@@ -983,12 +983,12 @@ file_impossible_p (const char *filename)
struct directory_contents *dir;
struct dirfile *dirfile;
struct dirfile dirfile_key;
-#ifdef VMS
+#if MK_OS_VMS
int want_vmsify = 0;
#endif
dirend = strrchr (filename, '/');
-#ifdef VMS
+#if MK_OS_VMS
if (dirend == NULL)
{
want_vmsify = (strpbrk (filename, "]>:^") != NULL);
@@ -1033,7 +1033,7 @@ file_impossible_p (const char *filename)
dirname = cp;
}
dir = find_directory (dirname)->contents;
-#ifdef VMS
+#if MK_OS_VMS
if (*slash == '/')
filename = slash + 1;
else
@@ -1053,7 +1053,7 @@ file_impossible_p (const char *filename)
#ifdef HAVE_CASE_INSENSITIVE_FS
filename = downcase (filename);
#endif
-#ifdef VMS
+#if MK_OS_VMS
if (want_vmsify)
filename = vmsify (filename, 1);
#endif
@@ -1274,8 +1274,8 @@ read_dirstream (void *stream)
* On MS-Windows, stat() "succeeds" for foo/bar/. where foo/bar is a
* regular file; fix that here.
*/
-#if !defined(stat) && !defined(WINDOWS32) || defined(VMS)
-# ifndef VMS
+#if !defined(stat) && !defined(WINDOWS32) || MK_OS_VMS
+# if !MK_OS_VMS
# ifndef HAVE_SYS_STAT_H
int stat (const char *path, struct stat *sbuf);
# endif
@@ -1314,8 +1314,8 @@ local_stat (const char *path, struct stat *buf)
#endif
/* Similarly for lstat. */
-#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
-# ifndef VMS
+#if !defined(lstat) && !defined(WINDOWS32) || MK_OS_VMS
+# if !MK_OS_VMS
# ifndef HAVE_SYS_STAT_H
int lstat (const char *path, struct stat *sbuf);
# endif
diff --git a/src/file.c b/src/file.c
index 666ae1fd..510f7d4a 100644
--- a/src/file.c
+++ b/src/file.c
@@ -73,7 +73,7 @@ lookup_file (const char *name)
{
struct file *f;
struct file file_key;
-#ifdef VMS
+#if MK_OS_VMS
int want_vmsify;
#ifndef WANT_CASE_SENSITIVE_TARGETS
char *lname;
@@ -85,7 +85,7 @@ lookup_file (const char *name)
/* This is also done in parse_file_seq, so this is redundant
for names read from makefiles. It is here for names passed
on the command line. */
-#ifdef VMS
+#if MK_OS_VMS
want_vmsify = (strpbrk (name, "]>:^") != NULL);
# ifndef WANT_CASE_SENSITIVE_TARGETS
if (*name != '.')
@@ -117,7 +117,7 @@ lookup_file (const char *name)
{
/* It was all slashes after a dot. */
name = "./";
-#if defined(VMS)
+#if MK_OS_VMS
/* TODO - This section is probably not needed. */
if (want_vmsify)
name = "[]";
@@ -125,7 +125,7 @@ lookup_file (const char *name)
}
file_key.hname = name;
f = hash_find_item (&files, &file_key);
-#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
+#if MK_OS_VMS && !defined(WANT_CASE_SENSITIVE_TARGETS)
if (*name != '.')
free (lname);
#endif
@@ -149,7 +149,7 @@ enter_file (const char *name)
assert (*name != '\0');
assert (! verify_flag || strcache_iscached (name));
-#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
+#if MK_OS_VMS && !defined(WANT_CASE_SENSITIVE_TARGETS)
if (*name != '.')
{
const char *n;
diff --git a/src/function.c b/src/function.c
index 417cb8e6..63ea50f8 100644
--- a/src/function.c
+++ b/src/function.c
@@ -520,7 +520,7 @@ func_notdir_suffix (char *o, char **argv, const char *funcname)
int is_suffix = funcname[0] == 's';
int is_notdir = !is_suffix;
int stop = MAP_DIRSEP | (is_suffix ? MAP_DOT : 0);
-#ifdef VMS
+#if MK_OS_VMS
/* For VMS list_iterator points to a comma separated list. To use the common
[find_]next_token, create a local copy and replace the commas with
spaces. Obviously, there is a problem if there is a ',' in the VMS filename
@@ -565,7 +565,7 @@ func_notdir_suffix (char *o, char **argv, const char *funcname)
if (is_notdir || p >= p2)
{
-#ifdef VMS
+#if MK_OS_VMS
if (vms_comma_separator)
o = variable_buffer_output (o, ",", 1);
else
@@ -596,7 +596,7 @@ func_basename_dir (char *o, char **argv, const char *funcname)
int is_basename = funcname[0] == 'b';
int is_dir = !is_basename;
int stop = MAP_DIRSEP | (is_basename ? MAP_DOT : 0) | MAP_NUL;
-#ifdef VMS
+#if MK_OS_VMS
/* As in func_notdir_suffix ... */
char *vms_p3 = alloca (strlen(p3) + 1);
int i;
@@ -625,7 +625,7 @@ func_basename_dir (char *o, char **argv, const char *funcname)
o = variable_buffer_output (o, p2, 2);
#endif
else if (is_dir)
-#ifdef VMS
+#if MK_OS_VMS
{
extern int vms_report_unix_paths;
if (vms_report_unix_paths)
@@ -635,12 +635,12 @@ func_basename_dir (char *o, char **argv, const char *funcname)
}
#else
o = variable_buffer_output (o, "./", 2);
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
else
/* The entire name is the basename. */
o = variable_buffer_output (o, p2, len);
-#ifdef VMS
+#if MK_OS_VMS
if (vms_comma_separator)
o = variable_buffer_output (o, ",", 1);
else
@@ -1807,7 +1807,7 @@ msdos_openpipe (int* pipedes, int *pidp, char *text)
Do shell spawning, with the naughty bits for different OSes.
*/
-#ifdef VMS
+#if MK_OS_VMS
/* VMS can't do $(shell ...) */
@@ -2000,7 +2000,7 @@ func_shell (char *o, char **argv, const char *funcname UNUSED)
{
return func_shell_base (o, argv, 1);
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
#ifdef EXPERIMENTAL
diff --git a/src/getopt.c b/src/getopt.c
index 7a792de8..2d75686a 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -68,7 +68,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
# include <unistd.h>
#endif /* GNU C library. */
-#ifdef VMS
+#if MK_OS_VMS
# include <unixlib.h>
# if HAVE_STRING_H - 0
# include <string.h>
diff --git a/src/implicit.c b/src/implicit.c
index 5fa30944..c40a50f4 100644
--- a/src/implicit.c
+++ b/src/implicit.c
@@ -284,7 +284,7 @@ pattern_search (struct file *file, int archive,
but not counting any slash at the end. (foo/bar/ counts as
bar/ in directory foo/, not empty in directory foo/bar/.) */
lastslash = memrchr (filename, '/', namelen - 1);
-#ifdef VMS
+#if MK_OS_VMS
if (lastslash == NULL)
lastslash = strrchr (filename, ']');
if (lastslash == NULL)
@@ -357,7 +357,7 @@ pattern_search (struct file *file, int archive,
check_lastslash = 0;
if (lastslash)
{
-#ifdef VMS
+#if MK_OS_VMS
check_lastslash = strpbrk (target, "/]>:") == NULL;
#else
check_lastslash = strchr (target, '/') == 0;
diff --git a/src/job.c b/src/job.c
index 92eeeb12..9a5d4b30 100644
--- a/src/job.c
+++ b/src/job.c
@@ -51,7 +51,7 @@ int batch_mode_shell = 0;
const char *default_shell = "/bin/sh";
int batch_mode_shell = 0;
-#elif defined (VMS)
+#elif MK_OS_VMS
# include <descrip.h>
# include <stsdef.h>
@@ -83,7 +83,7 @@ int dos_status;
int dos_command_running;
#endif /* __MSDOS__ */
-#ifdef VMS
+#if MK_OS_VMS
# ifndef __GNUC__
# include <processes.h>
# endif
@@ -179,7 +179,7 @@ int wait ();
int dup2 ();
int execve ();
void _exit ();
-# ifndef VMS
+# if !MK_OS_VMS
int geteuid ();
int getegid ();
int setgid ();
@@ -702,7 +702,7 @@ reap_children (int block, int err)
DB (DB_JOBS, (_("Live child %p (%s) PID %s %s\n"),
c, c->file->name, pid2str (c->pid),
c->remote ? _(" (remote)") : ""));
-#ifdef VMS
+#if MK_OS_VMS
break;
#endif
}
@@ -727,7 +727,7 @@ reap_children (int block, int err)
#if !defined(__MSDOS__) && !defined(WINDOWS32)
if (any_local)
{
-#ifdef VMS
+#if MK_OS_VMS
/* Todo: This needs more untangling multi-process support */
/* Just do single child process support now */
vmsWaitForChildren (&status);
@@ -746,7 +746,7 @@ reap_children (int block, int err)
else
#endif
EINTRLOOP (pid, wait (&status));
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
}
else
pid = 0;
@@ -1153,7 +1153,7 @@ start_job_command (struct child *child)
{
int flags;
char *p;
-#ifdef VMS
+#if MK_OS_VMS
# define FREE_ARGV(_a)
char *argv;
#else
@@ -1216,7 +1216,7 @@ start_job_command (struct child *child)
/* Figure out an argument list from this command line. */
{
char *end = 0;
-#ifdef VMS
+#if MK_OS_VMS
/* Skip any leading whitespace */
while (*p)
{
@@ -1275,7 +1275,7 @@ start_job_command (struct child *child)
if (argv != 0 && question_flag && NONE_SET (flags, COMMANDS_RECURSE))
{
FREE_ARGV (argv);
-#ifdef VMS
+#if MK_OS_VMS
/* On VMS, argv[0] can be a null string here */
if (argv[0] != 0)
{
@@ -1283,7 +1283,7 @@ start_job_command (struct child *child)
child->file->update_status = us_question;
notice_finished_file (child->file);
return;
-#ifdef VMS
+#if MK_OS_VMS
}
#endif
}
@@ -1351,7 +1351,7 @@ start_job_command (struct child *child)
performed some action (makes a difference as to what messages are
printed, etc. */
-#if !defined(VMS)
+#if !MK_OS_VMS
if (
#if defined __MSDOS__ || defined (__EMX__)
unixy_shell /* the test is complicated and we already did it */
@@ -1369,7 +1369,7 @@ start_job_command (struct child *child)
FREE_ARGV (argv);
goto next_command;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
/* If -n was given, recurse to get the next line in the sequence. */
@@ -1410,7 +1410,7 @@ start_job_command (struct child *child)
#if !defined(__MSDOS__) && !defined(WINDOWS32)
-#ifndef VMS
+#if !MK_OS_VMS
/* start_waiting_job has set CHILD->remote if we can start a remote job. */
if (child->remote)
{
@@ -1434,7 +1434,7 @@ start_job_command (struct child *child)
}
}
else
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
{
/* Fork the child process. */
run_local:
@@ -1442,7 +1442,7 @@ start_job_command (struct child *child)
child->remote = 0;
-#ifdef VMS
+#if MK_OS_VMS
child->pid = child_execute_job ((struct childbase *)child, 1, argv);
#else
@@ -1454,7 +1454,7 @@ start_job_command (struct child *child)
jobserver_post_child (ANY_SET (flags, COMMANDS_RECURSE));
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
}
#else /* __MSDOS__ or WINDOWS32 */
@@ -2017,7 +2017,7 @@ job_next_command (struct child *child)
static int
load_too_high (void)
{
-#if defined(__MSDOS__) || defined(VMS) || defined(__riscos__)
+#if defined(__MSDOS__) || MK_OS_VMS || defined(__riscos__)
return 1;
#else
static double last_sec;
@@ -2268,7 +2268,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
return pid;
}
-#elif !defined (__MSDOS__) && !defined (VMS)
+#elif !defined (__MSDOS__) && !MK_OS_VMS
/* POSIX:
Create a child process executing the command in ARGV.
@@ -2467,7 +2467,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
return pid;
}
-#endif /* !__MSDOS__ && !VMS */
+#endif /* !__MSDOS__ && !MK_OS_VMS */
#endif /* !WINDOWS32 */
/* Replace the current process with one running the command in ARGV,
@@ -2476,7 +2476,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
pid_t
exec_command (char **argv, char **envp)
{
-#ifdef VMS
+#if MK_OS_VMS
/* to work around a problem with signals and execve: ignore them */
#ifdef SIGCHLD
signal (SIGCHLD,SIG_IGN);
@@ -2653,10 +2653,10 @@ exec_command (char **argv, char **envp)
return pid;
#endif /* !WINDOWS32 */
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
}
-#ifndef VMS
+#if !MK_OS_VMS
/* Figure out the argument list necessary to run LINE as a command. Try to
avoid using a shell. This routine handles only ' quoting, and " quoting
when no backslash, $ or ' characters are seen in the quotes. Starting
@@ -3609,7 +3609,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
return new_argv;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
/* Figure out the argument list necessary to run LINE as a command. Try to
avoid using a shell. This routine handles only ' quoting, and " quoting
@@ -3738,6 +3738,6 @@ dup2 (int old, int new)
/* On VMS systems, include special VMS functions. */
-#ifdef VMS
+#if MK_OS_VMS
#include "vmsjobs.c"
#endif
diff --git a/src/job.h b/src/job.h
index 28f481ed..e0bdced2 100644
--- a/src/job.h
+++ b/src/job.h
@@ -18,7 +18,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
/* Structure describing a running or dead child process. */
-#ifdef VMS
+#if MK_OS_VMS
#define VMSCHILD \
char *comname; /* Temporary command file name */ \
int efn; /* Completion event flag number */ \
diff --git a/src/main.c b/src/main.c
index 5b9a141d..5b4e066b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -42,7 +42,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
# include <fcntl.h>
#endif
-#ifdef VMS
+#if MK_OS_VMS
int vms_use_mcr_command = 0;
int vms_always_use_cmd_file = 0;
int vms_gnv_shell = 0;
@@ -669,7 +669,7 @@ initialize_stopchar_map (void)
stopchar_map[(int)'\t'] = MAP_BLANK;
stopchar_map[(int)'/'] = MAP_DIRSEP;
-#if defined(VMS)
+#if MK_OS_VMS
stopchar_map[(int)':'] |= MAP_DIRSEP;
stopchar_map[(int)']'] |= MAP_DIRSEP;
stopchar_map[(int)'>'] |= MAP_DIRSEP;
@@ -1336,7 +1336,7 @@ main (int argc, char **argv, char **envp)
program = xstrndup (program, len - 4);
}
}
-#elif defined(VMS)
+#elif MK_OS_VMS
set_program_name (argv[0]);
program = program_name;
{
@@ -1677,7 +1677,7 @@ main (int argc, char **argv, char **envp)
fflush (stdout);
}
-#ifndef VMS
+#if !MK_OS_VMS
/* Set the "MAKE_COMMAND" variable to the name we were invoked with.
(If it is a relative pathname with a slash, prepend our directory name
so the result will run the same program regardless of the current dir.
@@ -1829,7 +1829,7 @@ main (int argc, char **argv, char **envp)
/* The extra indirection through $(MAKE_COMMAND) is done
for hysterical raisins. */
-#ifdef VMS
+#if MK_OS_VMS
if (vms_use_mcr_command)
define_variable_cname ("MAKE_COMMAND", vms_command (argv[0]), o_default, 0);
else
@@ -1885,7 +1885,7 @@ main (int argc, char **argv, char **envp)
a reference to this hidden variable is written instead. */
define_variable_cname ("MAKEOVERRIDES", "${-*-command-variables-*-}",
o_default, 1);
-#ifdef VMS
+#if MK_OS_VMS
vms_export_dcl_symbol ("MAKEOVERRIDES", "${-*-command-variables-*-}");
#endif
}
@@ -2110,7 +2110,7 @@ main (int argc, char **argv, char **envp)
no_default_sh_exe = !find_and_set_default_shell (NULL);
#endif /* WINDOWS32 */
-#if defined (__MSDOS__) || defined (__EMX__) || defined (VMS)
+#if defined (__MSDOS__) || defined (__EMX__) || MK_OS_VMS
/* We need to know what kind of shell we will be using. */
{
extern int _is_unixy_shell (const char *_path);
@@ -2155,7 +2155,7 @@ main (int argc, char **argv, char **envp)
else
job_slots = arg_job_slots;
-#if defined (__MSDOS__) || defined (__EMX__) || defined (VMS)
+#if defined (__MSDOS__) || defined (__EMX__) || MK_OS_VMS
if (job_slots != 1
# ifdef __EMX__
&& _osmode != OS2_MODE /* turn off -j if we are in DOS mode */
@@ -2700,7 +2700,7 @@ main (int argc, char **argv, char **envp)
{
*p = alloca (40);
sprintf (*p, "%s=%u", MAKELEVEL_NAME, makelevel);
-#ifdef VMS
+#if MK_OS_VMS
vms_putenv_symbol (*p);
#endif
}
@@ -2971,7 +2971,7 @@ handle_non_switch_argument (const char *arg, enum variable_origin origin)
/* Ignore plain '-' for compatibility. */
return;
-#ifdef VMS
+#if MK_OS_VMS
{
/* VMS DCL quoting can result in foo="bar baz" showing up here.
Need to remove the double quotes from the value. */
diff --git a/src/makeint.h b/src/makeint.h
index db896317..14f58483 100644
--- a/src/makeint.h
+++ b/src/makeint.h
@@ -94,6 +94,7 @@ extern int errno;
#endif
#ifdef __VMS
+# define MK_OS_VMS 1
/* In strict ANSI mode, VMS compilers should not be defining the
VMS macro. Define it here instead of a bulk edit for the correct code.
*/
@@ -106,7 +107,7 @@ extern int errno;
# include <unistd.h>
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself! */
-# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
+# if defined (_POSIX_VERSION) && !defined (ultrix) && !MK_OS_VMS
# define POSIX 1
# endif
#endif
@@ -197,7 +198,7 @@ unsigned int get_path_max (void);
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
-#ifdef VMS
+#if MK_OS_VMS
# include <fcntl.h>
# include <types.h>
# include <unixlib.h>
@@ -426,7 +427,7 @@ extern int unixy_shell;
/* The set of characters which are directory separators is OS-specific. */
#define MAP_DIRSEP 0x8000
-#ifdef VMS
+#if MK_OS_VMS
# define MAP_VMSCOMMA MAP_COMMA
#else
# define MAP_VMSCOMMA 0x0000
@@ -443,7 +444,7 @@ extern int unixy_shell;
# define PATH_SEPARATOR_CHAR ';'
# define MAP_PATHSEP MAP_SEMI
#elif !defined(PATH_SEPARATOR_CHAR)
-# if defined (VMS)
+# if MK_OS_VMS
# define PATH_SEPARATOR_CHAR (vms_comma_separator ? ',' : ':')
# define MAP_PATHSEP (vms_comma_separator ? MAP_COMMA : MAP_SEMI)
# else
@@ -516,7 +517,7 @@ extern struct rlimit stack_limit;
# define TTYNAME(_f) DEFAULT_TTYNAME
#endif
-#ifdef VMS
+#if MK_OS_VMS
# define DEFAULT_TMPDIR "/sys$scratch/"
#elif defined(P_tmpdir)
# define DEFAULT_TMPDIR P_tmpdir
@@ -618,7 +619,7 @@ typedef intmax_t (*ar_member_func_t) (int desc, const char *mem, int truncated,
intmax_t ar_scan (const char *archive, ar_member_func_t function,
const void *arg);
int ar_name_equal (const char *name, const char *mem, int truncated);
-#ifndef VMS
+#if !MK_OS_VMS
int ar_member_touch (const char *arname, const char *memname);
#endif
#endif
@@ -682,12 +683,12 @@ void dbg (const char *fmt, ...);
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
-# ifndef VMS
+# if !MK_OS_VMS
long int lseek ();
# endif
# ifdef HAVE_GETCWD
-# if !defined(VMS) && !defined(__DECC)
+# if !MK_OS_VMS && !defined(__DECC)
char *getcwd (void);
# endif
# else
@@ -766,7 +767,7 @@ extern double max_load_average;
extern const char *program;
-#ifdef VMS
+#if MK_OS_VMS
const char *vms_command (const char *argv0);
const char *vms_progname (const char *argv0);
diff --git a/src/misc.c b/src/misc.c
index eb14f405..f5bfee4c 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -572,7 +572,7 @@ umask (mode_t mask)
}
#endif
-#ifdef VMS
+#if MK_OS_VMS
# define DEFAULT_TMPFILE "sys$scratch:gnv$make_cmdXXXXXX.com"
#else
# define DEFAULT_TMPFILE "GmXXXXXX"
@@ -630,7 +630,7 @@ get_tmptemplate ()
template = xmalloc (strlen (tmpdir) + CSTRLEN (DEFAULT_TMPFILE) + 2);
cp = stpcpy (template, tmpdir);
-#if !defined VMS
+#if !MK_OS_VMS
/* It's not possible for tmpdir to be empty. */
if (! ISDIRSEP (cp[-1]))
*(cp++) = '/';
diff --git a/src/os.h b/src/os.h
index bf013689..c12f6641 100644
--- a/src/os.h
+++ b/src/os.h
@@ -20,7 +20,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
#define IO_STDOUT_OK 0x0008
#define IO_STDERR_OK 0x0010
-#if defined(VMS) || defined(__MSDOS__)
+#if MK_OS_VMS || defined(__MSDOS__)
# define check_io_state() (IO_STDIN_OK|IO_STDOUT_OK|IO_STDERR_OK)
# define fd_inherit(_i) (0)
# define fd_noinherit(_i) (0)
@@ -151,7 +151,7 @@ void osync_release (void);
#endif /* NO_OUTPUT_SYNC */
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
-#if defined(VMS) || defined(WINDOWS32) || defined(__MSDOS__)
+#if MK_OS_VMS || defined(WINDOWS32) || defined(__MSDOS__)
# define get_bad_stdin() (-1)
#else
int get_bad_stdin (void);
diff --git a/src/read.c b/src/read.c
index 4b65779f..0ac7becd 100644
--- a/src/read.c
+++ b/src/read.c
@@ -32,7 +32,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
#ifdef WINDOWS32
# include <windows.h>
# include "sub_proc.h"
-#elif defined(VMS)
+#elif MK_OS_VMS
struct passwd *getpwnam (char *name);
#else
# include <pwd.h>
@@ -223,17 +223,17 @@ read_all_makefiles (const char **makefiles)
if (num_makefiles == 0)
{
static const char *default_makefiles[] =
-#ifdef VMS
+#if MK_OS_VMS
/* all lower case since readdir() (the vms version) 'lowercasifies' */
/* TODO: Above is not always true, this needs more work */
{ "makefile.vms", "gnumakefile", "makefile", 0 };
#else
#ifdef WINDOWS32
{ "GNUmakefile", "makefile", "Makefile", "makefile.mak", 0 };
-#else /* !VMS && !WINDOWS32 */
+#else /* !MK_OS_VMS && !WINDOWS32 */
{ "GNUmakefile", "makefile", "Makefile", 0 };
-#endif /* !VMS && !WINDOWS32 */
-#endif /* VMS */
+#endif /* !MK_OS_VMS && !WINDOWS32 */
+#endif /* MK_OS_VMS */
const char **p = default_makefiles;
while (*p != 0 && !file_exists_p (*p))
++p;
@@ -3060,7 +3060,7 @@ construct_include_path (const char **arg_dirs)
char *
tilde_expand (const char *name)
{
-#if !defined(VMS)
+#if !MK_OS_VMS
if (name[1] == '/' || name[1] == '\0')
{
char *home_dir;
@@ -3123,7 +3123,7 @@ tilde_expand (const char *name)
*userend = '/';
}
# endif /* !WINDOWS32 */
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
return 0;
}
@@ -3234,7 +3234,7 @@ parse_file_seq (char **stringp, size_t size, int stopmap,
s = p;
p = find_map_unquote (p, findmap);
-#ifdef VMS
+#if MK_OS_VMS
/* convert comma separated list to space separated */
if (p && *p == ',')
*p =' ';
@@ -3261,7 +3261,7 @@ parse_file_seq (char **stringp, size_t size, int stopmap,
/* Strip leading "this directory" references. */
if (NONE_SET (flags, PARSEFS_NOSTRIP))
-#ifdef VMS
+#if MK_OS_VMS
/* Skip leading '[]'s. should only be one set or bug somewhere else */
if (p - s > 2 && s[0] == '[' && s[1] == ']')
s += 2;
@@ -3291,7 +3291,7 @@ parse_file_seq (char **stringp, size_t size, int stopmap,
}
else
{
-#ifdef VMS
+#if MK_OS_VMS
/* VMS filenames can have a ':' in them but they have to be '\'ed but we need
* to remove this '\' before we can use the filename.
* xstrdup called because S may be read-only string constant.
diff --git a/src/remake.c b/src/remake.c
index 12b12a61..d0d6fab1 100644
--- a/src/remake.c
+++ b/src/remake.c
@@ -30,7 +30,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
#include <sys/file.h>
#endif
-#ifdef VMS
+#if MK_OS_VMS
#include <starlet.h>
#endif
#ifdef WINDOWS32
@@ -1431,7 +1431,7 @@ f_mtime (struct file *file, int search)
/* If we found it in VPATH, see if it's in GPATH too; if so,
change the name right now; if not, defer until after the
dependencies are updated. */
-#ifndef VMS
+#if !MK_OS_VMS
name_len = strlen (name) - strlen (file->name) - 1;
#else
name_len = strlen (name) - strlen (file->name);
diff --git a/src/rule.c b/src/rule.c
index d0901f47..85b65ff5 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -171,7 +171,7 @@ snap_implicit_rules (void)
const char *dname = dep_name (dep);
size_t len = strlen (dname);
-#ifdef VMS
+#if MK_OS_VMS
const char *p = strrchr (dname, ']');
const char *p2;
if (p == 0)
@@ -250,7 +250,7 @@ convert_suffix_rule (const char *target, const char *source,
{
/* Special case: TARGET being nil means we are defining a '.X.a' suffix
rule; the target pattern is always '(%.o)'. */
-#ifdef VMS
+#if MK_OS_VMS
*names = strcache_add_len ("(%.obj)", 7);
#else
*names = strcache_add_len ("(%.o)", 5);
diff --git a/src/variable.c b/src/variable.c
index ec87ce9b..f9243afb 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -215,7 +215,7 @@ define_variable_in_set (const char *name, size_t length,
var_slot = (struct variable **) hash_find_slot (&set->table, &var_key);
v = *var_slot;
-#ifdef VMS
+#if MK_OS_VMS
/* VMS does not populate envp[] with DCL symbols and logical names which
historically are mapped to environment variables.
If the variable is not yet defined, then we need to check if getenv()
@@ -479,7 +479,7 @@ lookup_variable (const char *name, size_t length)
is_parent |= setlist->next_is_parent;
}
-#ifdef VMS
+#if MK_OS_VMS
/* VMS doesn't populate envp[] with DCL symbols and logical names, which
historically are mapped to environment variables and returned by
getenv(). */
@@ -534,7 +534,7 @@ lookup_variable (const char *name, size_t length)
return define_variable (vname, length, value, o_env, 1);
}
}
-#endif /* VMS */
+#endif /* MK_OS_VMS */
return 0;
}
diff --git a/src/vmsify.c b/src/vmsify.c
index d539f94f..036f11bb 100644
--- a/src/vmsify.c
+++ b/src/vmsify.c
@@ -24,7 +24,7 @@ this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
-#if VMS
+#if MK_OS_VMS
#include <unixlib.h>
#include <stdlib.h>
#include <jpidef.h>
diff --git a/src/vpath.c b/src/vpath.c
index 9c303bfb..0b9cd3d2 100644
--- a/src/vpath.c
+++ b/src/vpath.c
@@ -365,7 +365,7 @@ selective_vpath_search (struct vpath *path, const char *file,
/* Add the directory prefix already in *FILE. */
if (name_dplen > 0)
{
-#ifndef VMS
+#if !MK_OS_VMS
*p++ = '/';
#else
/* VMS: if this is not in VMS format, treat as Unix format */
@@ -381,7 +381,7 @@ selective_vpath_search (struct vpath *path, const char *file,
p[-1] = '/';
#endif
/* Now add the name-within-directory at the end of NAME. */
-#ifndef VMS
+#if !MK_OS_VMS
if (p != name && p[-1] != '/')
{
*p = '/';
@@ -440,7 +440,7 @@ selective_vpath_search (struct vpath *path, const char *file,
/* That file wasn't mentioned in the makefile.
See if it actually exists. */
-#ifdef VMS
+#if MK_OS_VMS
/* For VMS syntax just use the original vpath */
if (*p != '/')
exists_in_cache = exists = dir_file_exists_p (vpath[i], filename);
@@ -467,7 +467,7 @@ selective_vpath_search (struct vpath *path, const char *file,
struct stat st;
-#ifndef VMS
+#if !MK_OS_VMS
/* Put the slash back in NAME. */
*p = '/';
#else