[rtems-libbsd commit] Fix RTEMS ifdef labelling.

Chris Johns chrisj at rtems.org
Fri Jun 19 05:32:19 UTC 2015


Module:    rtems-libbsd
Branch:    master
Commit:    c31922b8c472c9f3fbe1349b1b01bd33e7072bdc
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=c31922b8c472c9f3fbe1349b1b01bd33e7072bdc

Author:    Chris Johns <chrisj at rtems.org>
Date:      Fri Jun 19 15:32:13 2015 +1000

Fix RTEMS ifdef labelling.

---

 freebsd/contrib/libpcap/gencode.c |  4 ++--
 freebsd/contrib/tcpdump/tcpdump.c | 20 ++++++++++----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/freebsd/contrib/libpcap/gencode.c b/freebsd/contrib/libpcap/gencode.c
index 8bee790..0c640ac 100644
--- a/freebsd/contrib/libpcap/gencode.c
+++ b/freebsd/contrib/libpcap/gencode.c
@@ -433,11 +433,11 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
 	     const char *buf, int optimize, bpf_u_int32 mask)
 #endif /* WIN32 */
 {
-#if __rtems__
+#ifdef __rtems__
 	int n_errors;
 #else
 	extern int n_errors;
-#endif
+#endif /* __rtems__ */
 	const char * volatile xbuf = buf;
 	u_int len;
 
diff --git a/freebsd/contrib/tcpdump/tcpdump.c b/freebsd/contrib/tcpdump/tcpdump.c
index 00e44db..39be032 100644
--- a/freebsd/contrib/tcpdump/tcpdump.c
+++ b/freebsd/contrib/tcpdump/tcpdump.c
@@ -39,6 +39,14 @@ static const char rcsid[] _U_ =
 
 /* $FreeBSD$ */
 
+#ifdef __rtems__
+#define __need_getopt_newlib
+#include <getopt.h>
+#define setpriority(a, b, c)
+#include <machine/rtems-bsd-program.h>
+#include <machine/rtems-bsd-commands.h>
+#endif /* __rtems__ */
+
 /*
  * tcpdump - monitor tcp/ip traffic on an ethernet.
  *
@@ -51,14 +59,6 @@ static const char rcsid[] _U_ =
 #include "config.h"
 #endif
 
-#if __rtems__
-#define __need_getopt_newlib
-#include <getopt.h>
-#define setpriority(a, b, c)
-#include <machine/rtems-bsd-program.h>
-#include <machine/rtems-bsd-commands.h>
-#endif
-
 #include <tcpdump-stdinc.h>
 
 #ifdef WIN32
@@ -2120,11 +2120,11 @@ static void verbose_stats_dump(int sig _U_)
 static void
 usage(void)
 {
-#if __rtems__
+#ifdef __rtems__
   #define version "RTEMS Version"
 #else
 	extern char version[];
-#endif
+#endif /* __rtems__ */
 #ifndef HAVE_PCAP_LIB_VERSION
 #if defined(WIN32) || defined(HAVE_PCAP_VERSION)
 	extern char pcap_version[];



More information about the vc mailing list