]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enum
authorJim Meyering <jim@meyering.net>
Sun, 19 Nov 2000 07:41:20 +0000 (07:41 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 19 Nov 2000 07:41:20 +0000 (07:41 +0000)
constants rather than macros.  Use values that cannot conflict
with C characters or with -1, CHAR_MAX + 1, etc.

src/sys2.h

index ed18a6cbcbcc22f6efed51ffa95b4d7d115f2ae2..74a9728ce6186f66a5b13aac68932ed6f007495b 100644 (file)
@@ -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