Fix #ifdefs that were broken due to commit d178b58.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 6 Nov 2017 07:13:03 +0000 (08:13 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 6 Nov 2017 07:13:03 +0000 (08:13 +0100)
src/getopt.c
src/getopt.h
src/getopt1.c
src/ipv4.h
src/net_setup.c
src/utils.c

index f84562c04d5b5c08605725d21ddd5ea6ac54da6b..1f6c27b5366a844cf289c0148fd34249770e4f76 100644 (file)
@@ -34,7 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "../config.h"
 #endif
 
-#if !defined (STDC) || !STDC
+#if !defined (__STDC__) || !__STDC__
 /* This is a separate conditional since some stdc systems
    reject `defined (const)'.  */
 #ifndef const
@@ -57,7 +57,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
    it is simpler to just do this in the source for each such file.  */
 
 #define GETOPT_INTERFACE_VERSION 2
-#if !defined (_LIBC) && defined (GLIBC) && GLIBC >= 2
+#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
 #include <gnu-versions.h>
 #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
 #define ELIDE_CODE
@@ -68,8 +68,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 
 /* This needs to come after some library #include
-   to get GNU_LIBRARY defined.  */
-#ifdef  GNU_LIBRARY
+   to get __GNU_LIBRARY__ defined.  */
+#ifdef  __GNU_LIBRARY__
 /* Don't include stdlib.h for non-GNU C libraries because some of them
    contain conflicting prototypes for getopt.  */
 #include <stdlib.h>
@@ -83,7 +83,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #endif
 #endif
 
-#if defined (WIN32) && !defined (CYGWIN32)
+#if defined (WIN32) && !defined (__CYGWIN32__32)
 /* It's not Unix, really.  See?  Capital letters.  */
 #include <windows.h>
 #define getpid() GetCurrentProcessId()
@@ -190,7 +190,7 @@ static enum {
 /* Value of POSIXLY_CORRECT environment variable.  */
 static char *posixly_correct;
 \f
-#ifdef  GNU_LIBRARY
+#ifdef  __GNU_LIBRARY__
 /* We want to avoid inclusion of string.h with non-GNU libraries
    because there are many ways it can cause trouble.
    On some systems, it contains special magic macros that don't work
@@ -222,17 +222,17 @@ int chr;
 
 /* If using GCC, we can safely declare strlen this way.
    If not using GCC, it is ok not to declare it.  */
-#ifdef GNUC
+#ifdef __GNUC__
 /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
    That was relevant to code that was here before.  */
-#if !defined (STDC) || !STDC
+#if !defined (__STDC__) || !__STDC__
 /* gcc with -traditional declares the built-in strlen to return int,
    and has done so at least since version 2.4.5. -- rms.  */
 extern int strlen(const char *);
-#endif /* not STDC */
-#endif /* GNUC */
+#endif /* not __STDC__ */
+#endif /* __GNUC__ */
 
-#endif /* not GNU_LIBRARY */
+#endif /* not __GNU_LIBRARY__ */
 \f
 /* Handle permutation of arguments.  */
 
@@ -291,7 +291,7 @@ text_set_element(libc_subinit, store_args_and_env);
    `first_nonopt' and `last_nonopt' are relocated so that they describe
    the new indices of the non-options in ARGV after they are moved.  */
 
-#if defined (STDC) && STDC
+#if defined (__STDC__) && __STDC__
 static void exchange(char **);
 #endif
 
@@ -374,7 +374,7 @@ char **argv;
 
 /* Initialize the internal data when the first call is made.  */
 
-#if defined (STDC) && STDC
+#if defined (__STDC__) && __STDC__
 static const char *_getopt_initialize(int, char *const *, const char *);
 #endif
 static const char *
index cd77d6758b5ee8db234885d29dc828bb1917ffce..ab1d40b3c7525699fbb99cde4ef1381e577ea16b 100644 (file)
@@ -79,7 +79,7 @@ extern "C" {
           returns the contents of the `val' field.  */
 
        struct option {
-#if defined (STDC) && STDC
+#if defined (__STDC__) && __STDC__
                const char *name;
 #else
                char *name;
@@ -97,15 +97,15 @@ extern "C" {
 #define required_argument       1
 #define optional_argument       2
 
-#if defined (STDC) && STDC
-#ifdef GNU_LIBRARY
+#if defined (__STDC__) && __STDC__
+#ifdef __GNU_LIBRARY__
        /* Many other libraries have conflicting prototypes for getopt, with
           differences in the consts, in stdlib.h.  To avoid compilation
           errors, only prototype getopt for the GNU C library.  */
        extern int getopt(int argc, char *const *argv, const char *shortopts);
-#else /* not GNU_LIBRARY */
+#else /* not __GNU_LIBRARY__ */
        extern int getopt();
-#endif /* GNU_LIBRARY */
+#endif /* __GNU_LIBRARY__ */
        extern int getopt_long(int argc, char *const *argv, const char *shortopts,
                               const struct option *longopts, int *longind);
        extern int getopt_long_only(int argc, char *const *argv,
@@ -117,13 +117,13 @@ extern "C" {
                                    const char *shortopts,
                                    const struct option *longopts, int *longind,
                                    int long_only);
-#else /* not STDC */
+#else /* not __STDC__ */
        extern int getopt();
        extern int getopt_long();
        extern int getopt_long_only();
 
        extern int _getopt_internal();
-#endif /* STDC */
+#endif /* __STDC__ */
 
 #ifdef  cplusplus
 }
index 87ee95e000d2edd46789bca1761a01dc39eee361..3ccb150ade88afdff6b51a34c5ab5fd4d3e4e453 100644 (file)
@@ -25,7 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "getopt.h"
 
-#if !defined (STDC) || !STDC
+#if !defined (__STDC__) || !__STDC__
 /* This is a separate conditional since some stdc systems
    reject `defined (const)'.  */
 #ifndef const
@@ -44,7 +44,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
    it is simpler to just do this in the source for each such file.  */
 
 #define GETOPT_INTERFACE_VERSION 2
-#if !defined (_LIBC) && defined (GLIBC) && GLIBC >= 2
+#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
 #include <gnu-versions.h>
 #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
 #define ELIDE_CODE
@@ -55,8 +55,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 
 /* This needs to come after some library #include
-   to get GNU_LIBRARY defined.  */
-#ifdef GNU_LIBRARY
+   to get __GNU_LIBRARY__ defined.  */
+#ifdef __GNU_LIBRARY__
 #include <stdlib.h>
 #endif
 
index 7f45ad7a6669cb7474359afabeeb016ab6394128..7979f7d47b7671f5e1bafc9c9524c45db91bb64b 100644 (file)
@@ -63,7 +63,7 @@
 
 #ifndef HAVE_STRUCT_IP
 struct ip {
-#if BYTE_ORDER == LITTLE_ENDIAN
+#if __BYTE_ORDER == __LITTLE_ENDIAN
        unsigned int ip_hl: 4;
        unsigned int ip_v: 4;
 #else
index 13719f52fbdf307581ef202c2638bbdc7b8269f5..5eddb1a76c3f2d7d04152cd72a4716e720cc9491 100644 (file)
@@ -239,7 +239,7 @@ static bool read_rsa_private_key(void) {
                return false;
        }
 
-#if !defined(HAVE_MINGW) && !defined(HAVE_CYGWIN)
+#if !defined(HAVE_MINGW) && !defined(HAVE___CYGWIN32__)
        struct stat s;
 
        if(!fstat(fileno(fp), &s)) {
@@ -860,7 +860,7 @@ static bool setup_myself(void) {
 #ifdef HAVE_MINGW
        Sleep(1000);
 #endif
-#ifdef HAVE_CYGWIN
+#ifdef HAVE___CYGWIN32__
        sleep(1);
 #endif
        execute_script("tinc-up", envp);
index 70a5c99d70c52532a188a6ac7fdb6ebb239129bc..28f60e877ad921bc5fd202e6f427887675f055fc 100644 (file)
@@ -54,8 +54,8 @@ void bin2hex(char *src, char *dst, int length) {
        }
 }
 
-#if defined(HAVE_MINGW) || defined(HAVE_CYGWIN)
-#ifdef HAVE_CYGWIN
+#if defined(HAVE_MINGW) || defined(HAVE___CYGWIN32__)
+#ifdef HAVE___CYGWIN32__
 #include <w32api/windows.h>
 #endif