summaryrefslogtreecommitdiff
path: root/src/makeint.h
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-12-17 11:01:31 -0500
committerPaul Smith <psmith@gnu.org>2022-12-18 20:06:38 -0500
commit5d1b757517b5ef3db5b7150fbcf7a310a3c627ce (patch)
tree7fe42cbc146e8d55d09f19e4eb00e00772674d5a /src/makeint.h
parentc0023150f176a91526d88b45eb02334add9059e1 (diff)
downloadmake-git-5d1b757517b5ef3db5b7150fbcf7a310a3c627ce.tar.gz
[SV 63516] [DOS] Support include files with drivespecs
* src/makeint.h (HAVE_DRIVESPEC): Create a macro to check. * src/main.c (.FEATURES): Add "dospaths" as a feature. * src/read.c (eval_makefile) [DOS]: If the included makefile name starts with a drivespec, don't search the include directories. * doc/make.texi (Include): Document this behavior. * tests/scripts/features/include: Add a test.
Diffstat (limited to 'src/makeint.h')
-rw-r--r--src/makeint.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/makeint.h b/src/makeint.h
index fa56d3d2..906cb3b6 100644
--- a/src/makeint.h
+++ b/src/makeint.h
@@ -414,6 +414,7 @@ extern int unixy_shell;
#define NONE_SET(_v,_m) (! ANY_SET ((_v),(_m)))
#define ALL_SET(_v,_m) (((_v)&(_m)) == (_m))
+/* Bitmasks for the STOPCHAR array. */
#define MAP_NUL 0x0001
#define MAP_BLANK 0x0002 /* space, TAB */
#define MAP_NEWLINE 0x0004
@@ -463,14 +464,13 @@ extern int unixy_shell;
# define MAP_PATHSEP MAP_SEMI
#elif PATH_SEPARATOR_CHAR == ','
# define MAP_PATHSEP MAP_COMMA
+
#else
# error "Unknown PATH_SEPARATOR_CHAR"
#endif
#define STOP_SET(_v,_m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m))
-/* True if C is a directory separator on the current system. */
-#define ISDIRSEP(c) STOP_SET((c),MAP_DIRSEP)
/* True if C is whitespace but not newline. */
#define ISBLANK(c) STOP_SET((c),MAP_BLANK)
/* True if C is whitespace including newlines. */
@@ -480,6 +480,18 @@ extern int unixy_shell;
/* Move S past all whitespace (including newlines). */
#define NEXT_TOKEN(s) while (ISSPACE (*(s))) ++(s)
+/* True if C is a directory separator on the current system. */
+#define ISDIRSEP(c) STOP_SET((c),MAP_DIRSEP)
+
+/* True if S starts with a drive specifier. */
+#if defined(HAVE_DOS_PATHS)
+# define HAS_DRIVESPEC(_s) ((((_s)[0] >= 'a' && (_s)[0] <= 'z') \
+ || ((_s)[0] >= 'A' && (_s)[0] <= 'Z')) \
+ && (_s)[1] == ':')
+#else
+# define HAS_DRIVESPEC(_s) 0
+#endif
+
/* We can't run setrlimit when using posix_spawn. */
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) && !defined(USE_POSIX_SPAWN)
# define SET_STACK_SIZE