use #ifdef CONFIG_* instead of #if CONFIG_*
authorGlenn L McGrath <bug1@ihug.co.nz>
Tue, 26 Nov 2002 09:02:06 +0000 (09:02 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Tue, 26 Nov 2002 09:02:06 +0000 (09:02 -0000)
libbb/interface.c
libbb/xconnect.c
networking/ifconfig.c
networking/netstat.c
networking/route.c

index b7353e5ad7d8115b19ad2a6f1cc4c908597804fc..2f43192657c1d71153ce98b627de83e91a87d686 100644 (file)
@@ -15,7 +15,7 @@
  *              that either displays or sets the characteristics of
  *              one or more of the system's networking interfaces.
  *
- * Version:     $Id: interface.c,v 1.10 2002/09/17 06:36:02 andersen Exp $
+ * Version:     $Id: interface.c,v 1.11 2002/11/26 09:02:04 bug1 Exp $
  *
  * Author:      Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
  *              and others.  Copyright 1993 MicroWalt Corporation
@@ -44,7 +44,6 @@
  * 
  */
 #define HAVE_AFINET 1
-#undef HAVE_AFINET6
 #undef HAVE_AFIPX
 #undef HAVE_AFATALK
 #undef HAVE_AFNETROM
 #undef HAVE_AFECONET
 #undef HAVE_AFASH
 
-#if CONFIG_FEATURE_IPV6
-#define HAVE_AFINET6 1
+#ifdef CONFIG_FEATURE_IPV6
+# define HAVE_AFINET6 1
+#else
+# undef HAVE_AFINET6
 #endif
 
 /* 
index f3a1b446209b9aaf3be15e19ef5a2fdacf7f92c8..bc6505a40036a34907d37768687162994788acb9 100644 (file)
@@ -17,7 +17,7 @@
 
 int xconnect(const char *host, const char *port)
 {
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
        struct addrinfo hints;
        struct addrinfo *res;
        struct addrinfo *addr_info;
index 513f176d1f28a805d7668e3ded081ecb3dd9e1f6..d0ee4c3a5a6583ce4fb321c47b27f19e329bc742 100644 (file)
@@ -15,7 +15,7 @@
  * Foundation;  either  version 2 of the License, or  (at
  * your option) any later version.
  *
- * $Id: ifconfig.c,v 1.19 2002/08/22 18:22:10 bug1 Exp $
+ * $Id: ifconfig.c,v 1.20 2002/11/26 09:02:05 bug1 Exp $
  *
  */
 
@@ -46,7 +46,7 @@
 #include "busybox.h"
 
 #ifdef CONFIG_FEATURE_IFCONFIG_SLIP
-#include <linux/if_slip.h>
+# include <linux/if_slip.h>
 #endif
 
 /* I don't know if this is needed for busybox or not.  Anyone? */
 
 /* Defines for glibc2.0 users. */
 #ifndef SIOCSIFTXQLEN
-#define SIOCSIFTXQLEN      0x8943
-#define SIOCGIFTXQLEN      0x8942
+# define SIOCSIFTXQLEN      0x8943
+# define SIOCGIFTXQLEN      0x8942
 #endif
 
 /* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */
 #ifndef ifr_qlen
-#define ifr_qlen        ifr_ifru.ifru_mtu
+# define ifr_qlen        ifr_ifru.ifru_mtu
 #endif
 
 #ifndef IFF_DYNAMIC
-#define IFF_DYNAMIC     0x8000 /* dialup device with changing addresses */
+# define IFF_DYNAMIC     0x8000        /* dialup device with changing addresses */
 #endif
 
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
 struct in6_ifreq {
        struct in6_addr ifr6_addr;
        uint32_t ifr6_prefixlen;
@@ -199,7 +199,7 @@ static const struct arg1opt Arg1Opt[] = {
        {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)},
 #endif
        /* Last entry if for unmatched (possibly hostname) arg. */
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
        {"SIOCSIFADDR", SIOCSIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */
        {"SIOCDIFADDR", SIOCDIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */
 #endif
@@ -228,7 +228,7 @@ static const struct options OptArray[] = {
        {"io_addr", N_ARG, ARG_IO_ADDR, 0},
        {"irq", N_ARG, ARG_IRQ, 0},
 #endif
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
        {"add", N_ARG, ARG_ADD_DEL, 0},
        {"del", N_ARG, ARG_ADD_DEL, 0},
 #endif
@@ -265,7 +265,7 @@ int ifconfig_main(int argc, char **argv)
        struct ifreq ifr;
        struct sockaddr_in sai;
 
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
        struct sockaddr_in6 sai6;
 #endif
 #ifdef CONFIG_FEATURE_IFCONFIG_HW
@@ -359,13 +359,13 @@ int ifconfig_main(int argc, char **argv)
 #ifdef CONFIG_FEATURE_IFCONFIG_HW
                                        if (mask & A_CAST_RESOLVE) {
 #endif
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
                                                char *prefix;
                                                int prefix_len = 0;
 #endif
 
                                                safe_strncpy(host, *argv, (sizeof host));
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
                                                if ((prefix = strchr(host, '/'))) {
                                                        prefix_len = atol(prefix + 1);
                                                        if ((prefix_len < 0) || (prefix_len > 128)) {
@@ -381,7 +381,7 @@ int ifconfig_main(int argc, char **argv)
                                                if (!strcmp(host, bb_INET_default)) {
                                                        /* Default is special, meaning 0.0.0.0. */
                                                        sai.sin_addr.s_addr = INADDR_ANY;
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
                                                } else
                                                        if (inet_pton(AF_INET6, host, &sai6.sin6_addr) >
                                                                0) {
index efca422ad44139a794993ca7802e78e4838d8044..d2b2d5ede3d107a8d4f6bf8497132bb7dc9dafa0 100644 (file)
@@ -627,19 +627,19 @@ int netstat_main(int argc, char **argv)
        }
        if (inet && flags&NETSTAT_TCP)
                do_info(_PATH_PROCNET_TCP,"AF INET (tcp)",tcp_do_one);
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
        if (inet6 && flags&NETSTAT_TCP)
                do_info(_PATH_PROCNET_TCP6,"AF INET6 (tcp)",tcp_do_one);
 #endif
        if (inet && flags&NETSTAT_UDP)
                do_info(_PATH_PROCNET_UDP,"AF INET (udp)",udp_do_one);
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
        if (inet6 && flags&NETSTAT_UDP)
                do_info(_PATH_PROCNET_UDP6,"AF INET6 (udp)",udp_do_one);
 #endif
        if (inet && flags&NETSTAT_RAW)
                do_info(_PATH_PROCNET_RAW,"AF INET (raw)",raw_do_one);
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
        if (inet6 && flags&NETSTAT_RAW)
                do_info(_PATH_PROCNET_RAW6,"AF INET6 (raw)",raw_do_one);
 #endif
index 5c4ce8ca31dc6cf5288716c36398847b0cb349d0..d4c65f8cdba3bb8d80edeb6098e473cfb5f645ad 100644 (file)
@@ -15,7 +15,7 @@
  * Foundation;  either  version 2 of the License, or  (at
  * your option) any later version.
  *
- * $Id: route.c,v 1.18 2002/08/22 18:24:43 bug1 Exp $
+ * $Id: route.c,v 1.19 2002/11/26 09:02:06 bug1 Exp $
  *
  * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
  * adjustments by Larry Doolittle  <LRDoolittle@lbl.gov>
@@ -331,7 +331,7 @@ static int INET_setroute(int action, int options, char **args)
        return EXIT_SUCCESS;
 }
 
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
 static int INET6_setroute(int action, int options, char **args)
 {
        struct in6_rtmsg rt;
@@ -560,7 +560,7 @@ void displayroutes(int noresolve, int netstatfmt)
        }
 }
 
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
 static void INET6_displayroutes(int noresolve)
 {
        char buff[256];
@@ -651,7 +651,7 @@ int route_main(int argc, char **argv)
        int opt;
        int what = 0;
 
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
        int af = AF_INET;
 #endif
 
@@ -669,7 +669,7 @@ int route_main(int argc, char **argv)
                                extended = 1;
                                break;
                        case 'A':
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
                                if (strcmp(optarg, "inet6") == 0)
                                        af = AF_INET6;
                                break;
@@ -679,7 +679,7 @@ int route_main(int argc, char **argv)
                        }
                }
 
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
                if (af == AF_INET6)
                        INET6_displayroutes(*argv != NULL);
                else
@@ -699,7 +699,7 @@ int route_main(int argc, char **argv)
                        show_usage();
        }
 
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
        if (af == AF_INET6)
                return INET6_setroute(what, 0, argv + 2);
 #endif