+1999-08-25 Paul D. Smith <psmith@gnu.org>
+
+ * Version 3.77.94 released.
+
+ * main.c (main) [__MSDOS__]: If the user uses -j, warn that it's
+ not supported and reset it.
+
+ * make.h (ISDIGIT): Obtained this from the textutils distribution.
+ * main.c (decode_switches): Use it.
+ * function.c (is_numeric): Use it.
+
+ * main.c (struct command_switch): Store the switch char in an
+ unsigned char to shut up GCC about using it with ctype.h macros.
+ Besides, it _is_ always unsigned.
+
1999-08-24 Paul D. Smith <psmith@gnu.org>
* make.texinfo: Change "dependency" to "prerequisite" and
* remake.c (update_file): Move the considered check into the
double-colon rule loop, so we consider double-colon rules
- individually (otherwise after the first is pruned, the rest might
- not get run).
+ individually (otherwise after the first is pruned, the rest won't
+ get run).
* README.template: Minor changes.
char *end = p + strlen (p) - 1;
char *beg = p;
strip_whitespace (&p, &end);
- while (p <= end)
- {
- if (!isdigit (*p))
- return 0;
- p++;
- }
+ while (p <= end)
+ if (!ISDIGIT (*(p++))) /* ISDIGIT only evals its arg once: see make.h. */
+ return 0;
return (end - beg >= 0);
}
struct command_switch
{
- char c; /* The switch character. */
+ unsigned char c; /* The switch character. */
enum /* Type of the value. */
{
/* We need to know what kind of shell we will be using. */
{
extern int _is_unixy_shell (const char *_path);
- struct variable *shv = lookup_variable("SHELL", 5);
+ struct variable *shv = lookup_variable ("SHELL", 5);
extern int unixy_shell;
extern char *default_shell;
decode_env_switches ("MFLAGS", 6);
#endif
+#ifdef __MSDOS__
+ if (job_slots != 1)
+ {
+ error (NILF, _("Parallel jobs (-j) are not supported on MS-DOS."));
+ error (NILF, _("Resetting to single job mode."));
+ job_slots = 1;
+ }
+#endif
+
#ifdef MAKE_JOBSERVER
/* If the jobserver-fds option is seen, make sure that -j is reasonable. */
}
else
{
- lastgoal->next
- = (struct dep *) xmalloc (sizeof (struct dep));
+ lastgoal->next = (struct dep *) xmalloc (sizeof (struct dep));
lastgoal = lastgoal->next;
}
lastgoal->name = 0;
case positive_int:
if (optarg == 0 && argc > optind
- && isdigit (argv[optind][0]))
+ && ISDIGIT (argv[optind][0]))
optarg = argv[optind++];
if (!doit)
if (i < 1)
{
if (doit)
- error (NILF, _("the `-%c' option requires a \
-positive integral argument"),
+ error (NILF, _("the `-%c' option requires a positive integral argument"),
cs->c);
bad = 1;
}
#ifndef NO_FLOAT
case floating:
if (optarg == 0 && optind < argc
- && (isdigit (argv[optind][0]) || argv[optind][0] == '.'))
+ && (ISDIGIT (argv[optind][0]) || argv[optind][0] == '.'))
optarg = argv[optind++];
if (doit)
# endif /* HAVE_ALLOCA_H. */
#endif /* GCC. */
+/* ISDIGIT offers the following features:
+ - Its arg may be any int or unsigned int; it need not be an unsigned char.
+ - It's guaranteed to evaluate its argument exactly once.
+ NOTE! Make relies on this behavior, don't change it!
+ - It's typically faster.
+ Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
+ only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless
+ it's important to use the locale's definition of `digit' even when the
+ host does not conform to Posix. */
+#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
+
#ifndef iAPX286
# define streq(a, b) \
((a) == (b) || \
register struct variable *v;
char *prefix;
{
- char *origin;
+ const char *origin;
switch (v->origin)
{
case o_invalid:
default:
abort ();
- break;
}
printf ("# %s\n", origin);