From aba2a0fd6d1db0f06fcd8840a538e64391430e38 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 19 Nov 2000 07:41:20 +0000 Subject: (GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum constants rather than macros. Use values that cannot conflict with C characters or with -1, CHAR_MAX + 1, etc. --- src/sys2.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sys2.h b/src/sys2.h index ed18a6cbc..74a9728ce 100644 --- a/src/sys2.h +++ b/src/sys2.h @@ -427,8 +427,14 @@ char *base_name PARAMS ((char const *)); /* Factor out some of the common --help and --version processing code. */ -#define GETOPT_HELP_CHAR 250 -#define GETOPT_VERSION_CHAR 251 +/* These enum values cannot possibly conflict with the option values + ordinarily used by commands, including CHAR_MAX + 1, etc. Avoid + CHAR_MIN - 1, as it may equal -1, the getopt end-of-options value. */ +enum +{ + GETOPT_HELP_CHAR = (CHAR_MIN - 2), + GETOPT_VERSION_CHAR = (CHAR_MIN - 3) +}; #define GETOPT_HELP_OPTION_DECL \ "help", no_argument, 0, GETOPT_HELP_CHAR -- cgit v1.2.3-70-g09d2