summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-11-19 07:41:20 +0000
committerJim Meyering <jim@meyering.net>2000-11-19 07:41:20 +0000
commitaba2a0fd6d1db0f06fcd8840a538e64391430e38 (patch)
tree0fc25a54cccbc5e8834f65c3a35d3abd6b0700db /src
parent5baa94d136b0d72060474bbfe1ae38ee88ad6727 (diff)
downloadcoreutils-aba2a0fd6d1db0f06fcd8840a538e64391430e38.tar.xz
(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.
Diffstat (limited to 'src')
-rw-r--r--src/sys2.h10
1 files changed, 8 insertions, 2 deletions
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