Code

control: Updated standards-version to 3.9.5 -- no changes.
[pkg-rrdtool.git] / src / rrd_getopt.c
index d206af0bf62e84242099dedaf2c14c925525606a..46f7313473caf6bc8b57f952e3b4e05e7c6e3ed9 100644 (file)
@@ -30,9 +30,8 @@
 #define _NO_PROTO
 #endif
 
-#ifndef WIN32
 
-#if !defined (__STDC__) || !__STDC__
+#if !defined WIN32 && (!defined (__STDC__) || !__STDC__)
 /* This is a separate conditional since some stdc systems
    reject `defined (const)'.  */
 #ifndef const
 #endif
 #endif
 
-#endif // WIN32
-
+#ifndef WIN32
 #ifdef HAVE_CONFIG_H
 #include "../rrd_config.h"
 #endif
+#endif
 
 #include "rrd_i18n.h"
 
@@ -227,15 +226,7 @@ static char *posixly_correct;
 char     *getenv(
     );
 
-#ifdef WIN32
 static char* my_index(const char* str, int chr)
-#else // WIN32
-static char *my_index(
-    str,
-    chr)
-    const char *str;
-    int chr;
-#endif // wIN32
 {
     while (*str) {
         if (*str == chr)
@@ -284,7 +275,8 @@ static char *const *original_argv;
    to getopt is that one passed to the process.  */
 static void store_args(
     int argc,
-    char *const *argv) __attribute__ ((unused));
+    char *const *argv);
+
 static void store_args(
     int argc,
     char *const *argv)
@@ -312,13 +304,7 @@ static void exchange(
     char **);
 #endif
 
-#ifdef WIN32
 static void exchange(char** argv)
-#else // WIN32
-static void exchange(
-    argv)
-    char    **argv;
-#endif // WIN32
 {
     int       bottom = first_nonopt;
     int       middle = last_nonopt;
@@ -374,20 +360,9 @@ static const char *_getopt_initialize(
     char *const *,
     const char *);
 #endif
-
-#ifdef WIN32
 static const char* _getopt_initialize(int argc,
-                                      char** argv,
+                                      char* const* argv,
                                       const char* optstring)
-#else // WIN32
-static const char *_getopt_initialize(
-    argc,
-    argv,
-    optstring)
-    int argc;
-    char     *const *argv;
-    const char *optstring;
-#endif // WIN32
 {
     /* Start processing options with ARGV-element 1 (since ARGV-element 0
        is the program name); the sequence of previously skipped
@@ -490,28 +465,16 @@ static const char *_getopt_initialize(
    If LONG_ONLY is nonzero, '-' as well as '--' can introduce
    long-named options.  */
 
-#ifdef WIN32
 int _getopt_internal(int argc,
+#ifdef WIN32
                      char** argv,
+#else // WIN32
+                     char* const* argv,
+#endif //WIN32
                      const char *optstring,
                      const struct option *longopts,
                      int* longind,
                      int long_only)
-#else // WIN32
-int _getopt_internal(
-    argc,
-    argv,
-    optstring,
-    longopts,
-    longind,
-    long_only)
-    int argc;
-    char     *const *argv;
-    const char *optstring;
-    const struct option *longopts;
-    int      *longind;
-    int long_only;
-#endif // WIN32
 {
     optarg = NULL;
 
@@ -911,25 +874,6 @@ int _getopt_internal(
     }
 }
 
-#ifdef WIN32
-int getopt(
-    int argc,
-    char** argv,
-    const char* optstring)
-#else // WIN32
-int getopt(
-    argc,
-    argv,
-    optstring)
-    int argc;
-    char     *const *argv;
-    const char *optstring;
-#endif // WIN32
-{
-    return _getopt_internal(argc, argv, optstring,
-                            (const struct option *) 0, (int *) 0, 0);
-}
-
 #endif                          /* Not ELIDE_CODE.  */
 \f
 #ifdef TEST