Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Feb 2021 00:36:58 GMT
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 57785538c6e0 - main - Simplify the FreeBSD check using __FreeBSD__ compiler macro.
Message-ID:  <202102090036.1190awOp087118@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=57785538c6e0d7e8ca0f161ab95bae10fd304047

commit 57785538c6e0d7e8ca0f161ab95bae10fd304047
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-02-07 03:22:52 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-02-09 00:36:27 +0000

    Simplify the FreeBSD check using __FreeBSD__ compiler macro.
    
    Rather than rely on __FreeBSD_version, defined in sys/param.h, use
    __FreeBSD__ defined by the compiler.
    
    Reported by:    emaste
    MFC after:      1 week
---
 contrib/ipfilter/ip_dstlist.c                 |  2 +-
 contrib/ipfilter/ip_fil_compat.c              |  2 +-
 contrib/ipfilter/ipf.h                        |  2 +-
 contrib/ipfilter/ipsend/sbpf.c                |  2 +-
 contrib/ipfilter/ipsend/sock.c                |  2 +-
 sys/contrib/ipfilter/netinet/fil.c            |  6 +++---
 sys/contrib/ipfilter/netinet/ip_auth.c        |  8 ++++----
 sys/contrib/ipfilter/netinet/ip_compat.h      |  6 +++---
 sys/contrib/ipfilter/netinet/ip_dstlist.c     |  2 +-
 sys/contrib/ipfilter/netinet/ip_fil.h         |  8 ++++----
 sys/contrib/ipfilter/netinet/ip_fil_freebsd.c |  6 +++---
 sys/contrib/ipfilter/netinet/ip_frag.c        |  2 +-
 sys/contrib/ipfilter/netinet/ip_htable.c      |  2 +-
 sys/contrib/ipfilter/netinet/ip_log.c         | 12 ++++++------
 sys/contrib/ipfilter/netinet/ip_lookup.c      |  2 +-
 sys/contrib/ipfilter/netinet/ip_nat.c         | 10 +++++-----
 sys/contrib/ipfilter/netinet/ip_nat6.c        |  8 ++++----
 sys/contrib/ipfilter/netinet/ip_pool.c        |  2 +-
 sys/contrib/ipfilter/netinet/ip_proxy.c       | 10 +++++-----
 sys/contrib/ipfilter/netinet/ip_rules.c       |  2 +-
 sys/contrib/ipfilter/netinet/ip_state.c       |  8 ++++----
 sys/contrib/ipfilter/netinet/ip_sync.c        |  6 +++---
 sys/contrib/ipfilter/netinet/mlfk_ipl.c       | 18 +++++++++---------
 23 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/contrib/ipfilter/ip_dstlist.c b/contrib/ipfilter/ip_dstlist.c
index 14b071b0b95f..2802ef694aa9 100644
--- a/contrib/ipfilter/ip_dstlist.c
+++ b/contrib/ipfilter/ip_dstlist.c
@@ -41,7 +41,7 @@
 # include <sys/stream.h>
 # include <sys/kmem.h>
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 #endif
 
diff --git a/contrib/ipfilter/ip_fil_compat.c b/contrib/ipfilter/ip_fil_compat.c
index 6184502e0f58..0b426f5d9c48 100644
--- a/contrib/ipfilter/ip_fil_compat.c
+++ b/contrib/ipfilter/ip_fil_compat.c
@@ -14,7 +14,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/file.h>
-#if defined(__FreeBSD_version) && defined(_KERNEL)
+#if defined(__FreeBSD__) && defined(_KERNEL)
 # include <sys/fcntl.h>
 # include <sys/filio.h>
 #else
diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h
index c7f7308a9ba9..e178cfc1676e 100644
--- a/contrib/ipfilter/ipf.h
+++ b/contrib/ipfilter/ipf.h
@@ -172,7 +172,7 @@ typedef	struct	proxyrule {
 } proxyrule_t;
 
 
-#if defined(__NetBSD__) || defined(__FreeBSD_version) || \
+#if defined(__NetBSD__) || defined(__FreeBSD__) || \
 	SOLARIS
 # include <stdarg.h>
 typedef	int	(* ioctlfunc_t)(int, ioctlcmd_t, ...);
diff --git a/contrib/ipfilter/ipsend/sbpf.c b/contrib/ipfilter/ipsend/sbpf.c
index 9b4f20c3fea9..f3b8d2f37775 100644
--- a/contrib/ipfilter/ipsend/sbpf.c
+++ b/contrib/ipfilter/ipsend/sbpf.c
@@ -12,7 +12,7 @@
 #include <sys/socket.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 # include <sys/dirent.h>
 #else
 # include <sys/dir.h>
diff --git a/contrib/ipfilter/ipsend/sock.c b/contrib/ipfilter/ipsend/sock.c
index ddb59eb029f8..7754ef9d8e1c 100644
--- a/contrib/ipfilter/ipsend/sock.c
+++ b/contrib/ipfilter/ipsend/sock.c
@@ -168,7 +168,7 @@ struct	tcpcb	*find_tcp(tfd, ti)
 	fd = (struct filedesc *)malloc(sizeof(*fd));
 	if (fd == NULL)
 		return NULL;
-#if defined( __FreeBSD_version)
+#if defined( __FreeBSD__)
 	if (KMCPY(fd, p->ki_fd, sizeof(*fd)) == -1)
 	    {
 		fprintf(stderr, "read(%#lx,%#lx) failed\n",
diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c
index 2dca1e754b9e..09b4c27a1cb4 100644
--- a/sys/contrib/ipfilter/netinet/fil.c
+++ b/sys/contrib/ipfilter/netinet/fil.c
@@ -20,7 +20,7 @@
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/time.h>
-#if defined(_KERNEL) && defined(__FreeBSD_version)
+#if defined(_KERNEL) && defined(__FreeBSD__)
 #  if !defined(IPFILTER_LKM)
 #   include "opt_inet6.h"
 #  endif
@@ -91,7 +91,7 @@
 #if defined(IPFILTER_BPF) && defined(_KERNEL)
 # include <net/bpf.h>
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 #endif
 #include "netinet/ipl.h"
@@ -2886,7 +2886,7 @@ ipf_check(ctx, ip, hlen, ifp, out
 	 */
 	m->m_flags &= ~M_CANFASTFWD;
 #  endif /* M_CANFASTFWD */
-#  if defined(CSUM_DELAY_DATA) && !defined(__FreeBSD_version)
+#  if defined(CSUM_DELAY_DATA) && !defined(__FreeBSD__)
 	/*
 	 * disable delayed checksums.
 	 */
diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c
index c40bb1b435f2..881dab1aaea8 100644
--- a/sys/contrib/ipfilter/netinet/ip_auth.c
+++ b/sys/contrib/ipfilter/netinet/ip_auth.c
@@ -27,7 +27,7 @@
 # include <sys/uio.h>
 # undef _KERNEL
 #endif
-#if defined(_KERNEL) && defined(__FreeBSD_version)
+#if defined(_KERNEL) && defined(__FreeBSD__)
 # include <sys/filio.h>
 # include <sys/fcntl.h>
 #else
@@ -50,7 +50,7 @@
 # include <sys/stream.h>
 # include <sys/kmem.h>
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/queue.h>
 #endif
 #if defined(__NetBSD__)
@@ -81,7 +81,7 @@
 # undef	KERNEL
 #endif
 #include <netinet/tcp.h>
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <net/if_var.h>
 # define IF_QFULL _IF_QFULL
 # define IF_DROP _IF_DROP
@@ -100,7 +100,7 @@
 #  include <machine/cpufunc.h>
 # endif
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 # if defined(_KERNEL) && !defined(IPFILTER_LKM)
 #  include <sys/libkern.h>
diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h
index 3de517b4559d..5c00f8d37e40 100644
--- a/sys/contrib/ipfilter/netinet/ip_compat.h
+++ b/sys/contrib/ipfilter/netinet/ip_compat.h
@@ -101,7 +101,7 @@
  * There may be other, safe, kernels but this is not extensively tested yet.
  */
 # define HAVE_M_PULLDOWN
-# if !defined(IPFILTER_LKM) && defined(__FreeBSD_version)
+# if !defined(IPFILTER_LKM) && defined(__FreeBSD__)
 #  include "opt_ipfilter.h"
 # endif
 # define	COPYIN(a,b,c)	copyin((caddr_t)(a), (caddr_t)(b), (c))
@@ -282,7 +282,7 @@ typedef union {
 #define	ipf_isw		ipf_lkun_s.ipf_sw
 #define	ipf_magic	ipf_lkun_s.ipf_magic
 
-#if !defined(__GNUC__) || defined(__FreeBSD_version)
+#if !defined(__GNUC__) || defined(__FreeBSD__)
 # ifndef	INLINE
 #  define	INLINE
 # endif
@@ -290,7 +290,7 @@ typedef union {
 # define	INLINE	__inline__
 #endif
 
-#if defined(__FreeBSD_version) && defined(_KERNEL)
+#if defined(__FreeBSD__) && defined(_KERNEL)
      CTASSERT(sizeof(ipfrwlock_t) == KRWLOCK_FILL_SZ);
      CTASSERT(sizeof(ipfmutex_t) == KMUTEX_FILL_SZ);
 #endif
diff --git a/sys/contrib/ipfilter/netinet/ip_dstlist.c b/sys/contrib/ipfilter/netinet/ip_dstlist.c
index 11e1a1846d89..af584d8e4d72 100644
--- a/sys/contrib/ipfilter/netinet/ip_dstlist.c
+++ b/sys/contrib/ipfilter/netinet/ip_dstlist.c
@@ -41,7 +41,7 @@
 # include <sys/stream.h>
 # include <sys/kmem.h>
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 #endif
 
diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h
index 72def439b3e8..8cb988e1fd17 100644
--- a/sys/contrib/ipfilter/netinet/ip_fil.h
+++ b/sys/contrib/ipfilter/netinet/ip_fil.h
@@ -1374,7 +1374,7 @@ typedef	struct	ipftune	{
 ** HPUX Port
 */
 
-#if !defined(CDEV_MAJOR) && defined (__FreeBSD_version)
+#if !defined(CDEV_MAJOR) && defined (__FreeBSD__)
 # define	CDEV_MAJOR	79
 #endif
 
@@ -1567,7 +1567,7 @@ typedef struct ipf_main_softc_s {
 	frentry_t	*ipf_rule_explist[2];
 	ipftoken_t	*ipf_token_head;
 	ipftoken_t	**ipf_token_tail;
-#if defined(__FreeBSD_version) && defined(_KERNEL)
+#if defined(__FreeBSD__) && defined(_KERNEL)
 	struct callout ipf_slow_ch;
 #endif
 #if NETBSD_GE_REV(104040000)
@@ -1641,14 +1641,14 @@ extern	size_t	mbufchainlen(mb_t *);
 #  ifdef	IPFILTER_LKM
 extern	int	ipf_identify(char *);
 #  endif
-#  if defined(__FreeBSD_version)
+#  if defined(__FreeBSD__)
 extern	int	ipfioctl(struct cdev*, u_long, caddr_t, int, struct thread *);
 #  elif defined(__NetBSD__)
 extern	int	ipfioctl(dev_t, u_long, void *, int, struct lwp *);
 #  endif
 # endif /* SOLARIS */
 
-# if defined(__FreeBSD_version)
+# if defined(__FreeBSD__)
 extern	int	ipf_pfil_hook(void);
 extern	int	ipf_pfil_unhook(void);
 extern	void	ipf_event_reg(void);
diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
index 39fe0933f417..9f03ab3bf946 100644
--- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
+++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
@@ -16,11 +16,11 @@ static const char rcsid[] = "@(#)$Id$";
 # define	KERNEL	1
 # define	_KERNEL	1
 #endif
-#if defined(__FreeBSD_version) && \
+#if defined(__FreeBSD__) && \
     !defined(KLD_MODULE) && !defined(IPFILTER_LKM)
 # include "opt_inet6.h"
 #endif
-#if defined(__FreeBSD_version) && \
+#if defined(__FreeBSD__) && \
     !defined(KLD_MODULE) && !defined(IPFILTER_LKM)
 # include "opt_random_ip_id.h"
 #endif
@@ -35,7 +35,7 @@ static const char rcsid[] = "@(#)$Id$";
 #include <sys/time.h>
 #include <sys/systm.h>
 #include <sys/dirent.h>
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/jail.h>
 #endif
 #include <sys/malloc.h>
diff --git a/sys/contrib/ipfilter/netinet/ip_frag.c b/sys/contrib/ipfilter/netinet/ip_frag.c
index 0636f27c81e8..93bcc2ed9415 100644
--- a/sys/contrib/ipfilter/netinet/ip_frag.c
+++ b/sys/contrib/ipfilter/netinet/ip_frag.c
@@ -24,7 +24,7 @@
 # include <sys/uio.h>
 # undef _KERNEL
 #endif
-#if defined(_KERNEL) && defined(__FreeBSD_version)
+#if defined(_KERNEL) && defined(__FreeBSD__)
 # include <sys/filio.h>
 # include <sys/fcntl.h>
 #else
diff --git a/sys/contrib/ipfilter/netinet/ip_htable.c b/sys/contrib/ipfilter/netinet/ip_htable.c
index bd76c2b5b0be..bd1a7136086f 100644
--- a/sys/contrib/ipfilter/netinet/ip_htable.c
+++ b/sys/contrib/ipfilter/netinet/ip_htable.c
@@ -24,7 +24,7 @@
 # undef _KERNEL
 #endif
 #include <sys/socket.h>
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 #endif
 #if defined(__FreeBSD__)
diff --git a/sys/contrib/ipfilter/netinet/ip_log.c b/sys/contrib/ipfilter/netinet/ip_log.c
index d7acaf1ebf4e..7a80b3e0d4e7 100644
--- a/sys/contrib/ipfilter/netinet/ip_log.c
+++ b/sys/contrib/ipfilter/netinet/ip_log.c
@@ -39,7 +39,7 @@
 # undef _KERNEL
 # undef KERNEL
 #endif
-#if defined(__FreeBSD_version) && defined(_KERNEL)
+#if defined(__FreeBSD__) && defined(_KERNEL)
 # include <sys/fcntl.h>
 # include <sys/filio.h>
 #else
@@ -52,12 +52,12 @@
 #  include <sys/proc.h>
 # endif
 #endif /* _KERNEL */
-# if defined(NetBSD) || defined(__FreeBSD_version)
+# if defined(NetBSD) || defined(__FreeBSD__)
 #  include <sys/dirent.h>
 # include <sys/mbuf.h>
 # include <sys/select.h>
 # endif
-# if defined(__FreeBSD_version)
+# if defined(__FreeBSD__)
 #  include <sys/selinfo.h>
 # endif
 #if SOLARIS && defined(_KERNEL)
@@ -78,7 +78,7 @@
 #ifdef sun
 # include <net/af.h>
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <net/if_var.h>
 #endif
 #include <netinet/in.h>
@@ -102,7 +102,7 @@
 #include "netinet/ip_frag.h"
 #include "netinet/ip_state.h"
 #include "netinet/ip_auth.h"
-#if defined(__FreeBSD_version) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 # include <sys/malloc.h>
 #endif
 /* END OF INCLUDES */
@@ -443,7 +443,7 @@ ipf_log_pkt(fin, flags)
 	COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname);
 # else
 #  if (defined(NetBSD) && (NetBSD  <= 1991011) && (NetBSD >= 199603)) || \
-      defined(__FreeBSD_version)
+      defined(__FreeBSD__)
 	COPYIFNAME(fin->fin_v, ifp, ipfl.fl_ifname);
 #  else
 	ipfl.fl_unit = (u_int)ifp->if_unit;
diff --git a/sys/contrib/ipfilter/netinet/ip_lookup.c b/sys/contrib/ipfilter/netinet/ip_lookup.c
index f25174a752ec..66dec84944a1 100644
--- a/sys/contrib/ipfilter/netinet/ip_lookup.c
+++ b/sys/contrib/ipfilter/netinet/ip_lookup.c
@@ -15,7 +15,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/file.h>
-#if defined(__FreeBSD_version) && defined(_KERNEL)
+#if defined(__FreeBSD__) && defined(_KERNEL)
 # include <sys/fcntl.h>
 # include <sys/filio.h>
 #else
diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c
index 17c1133e145d..33d190c61a0a 100644
--- a/sys/contrib/ipfilter/netinet/ip_nat.c
+++ b/sys/contrib/ipfilter/netinet/ip_nat.c
@@ -31,7 +31,7 @@ struct file;
 # include <sys/uio.h>
 # undef KERNEL
 #endif
-#if defined(_KERNEL) && defined(__FreeBSD_version)
+#if defined(_KERNEL) && defined(__FreeBSD__)
 # include <sys/filio.h>
 # include <sys/fcntl.h>
 #else
@@ -55,11 +55,11 @@ struct file;
 # include <sys/stream.h>
 # include <sys/kmem.h>
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/queue.h>
 #endif
 #include <net/if.h>
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <net/if_var.h>
 #endif
 #ifdef sun
@@ -90,7 +90,7 @@ extern struct ifnet vpnif;
 #include "netinet/ip_lookup.h"
 #include "netinet/ip_dstlist.h"
 #include "netinet/ip_sync.h"
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 #endif
 #ifdef HAS_SYS_MD5_H
@@ -1017,7 +1017,7 @@ ipf_nat_ioctl(softc, data, cmd, mode, uid, ctx)
 				     KAUTH_REQ_NETWORK_FIREWALL_FW,
 				     NULL, NULL, NULL))
 # else
-#  if defined(__FreeBSD_version)
+#  if defined(__FreeBSD__)
 	if (securelevel_ge(curthread->td_ucred, 3) && (mode & FWRITE))
 #  else
 	if ((securelevel >= 3) && (mode & FWRITE))
diff --git a/sys/contrib/ipfilter/netinet/ip_nat6.c b/sys/contrib/ipfilter/netinet/ip_nat6.c
index 13fa6fb6bc30..921eefc0ea3f 100644
--- a/sys/contrib/ipfilter/netinet/ip_nat6.c
+++ b/sys/contrib/ipfilter/netinet/ip_nat6.c
@@ -29,7 +29,7 @@ struct file;
 # include <sys/uio.h>
 # undef _KERNEL
 #endif
-#if defined(_KERNEL) && defined(__FreeBSD_version)
+#if defined(_KERNEL) && defined(__FreeBSD__)
 # include <sys/filio.h>
 # include <sys/fcntl.h>
 #else
@@ -53,11 +53,11 @@ struct file;
 # include <sys/stream.h>
 # include <sys/kmem.h>
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/queue.h>
 #endif
 #include <net/if.h>
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <net/if_var.h>
 #endif
 #ifdef sun
@@ -88,7 +88,7 @@ extern struct ifnet vpnif;
 #include "netinet/ip_lookup.h"
 #include "netinet/ip_dstlist.h"
 #include "netinet/ip_sync.h"
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 #endif
 #ifdef HAS_SYS_MD5_H
diff --git a/sys/contrib/ipfilter/netinet/ip_pool.c b/sys/contrib/ipfilter/netinet/ip_pool.c
index 51d810baa310..fdd83ebd977f 100644
--- a/sys/contrib/ipfilter/netinet/ip_pool.c
+++ b/sys/contrib/ipfilter/netinet/ip_pool.c
@@ -38,7 +38,7 @@
 # include <sys/stream.h>
 # include <sys/kmem.h>
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 #endif
 
diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c
index 2c6b4eb6369d..b4773bb6f358 100644
--- a/sys/contrib/ipfilter/netinet/ip_proxy.c
+++ b/sys/contrib/ipfilter/netinet/ip_proxy.c
@@ -29,7 +29,7 @@
 # include <sys/protosw.h>
 #include <sys/socket.h>
 #if defined(_KERNEL)
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 #  include <sys/ctype.h>
 # endif
 # include <sys/systm.h>
@@ -37,7 +37,7 @@
 #  include <sys/mbuf.h>
 # endif
 #endif
-#if defined(_KERNEL) && defined(__FreeBSD_version)
+#if defined(_KERNEL) && defined(__FreeBSD__)
 # include <sys/filio.h>
 # include <sys/fcntl.h>
 #else
@@ -51,11 +51,11 @@
 # include <sys/stream.h>
 # include <sys/kmem.h>
 #endif
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 # include <sys/queue.h>
 #endif
 #include <net/if.h>
-#if defined(__FreeBSD_version) && defined(_KERNEL)
+#if defined(__FreeBSD__) && defined(_KERNEL)
 #include <net/vnet.h>
 #else
 #define CURVNET_SET(arg)
@@ -80,7 +80,7 @@
 #include "netinet/ip_nat.h"
 #include "netinet/ip_state.h"
 #include "netinet/ip_proxy.h"
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 #endif
 
diff --git a/sys/contrib/ipfilter/netinet/ip_rules.c b/sys/contrib/ipfilter/netinet/ip_rules.c
index 2fb61e9d91bf..fcf6923adeb3 100644
--- a/sys/contrib/ipfilter/netinet/ip_rules.c
+++ b/sys/contrib/ipfilter/netinet/ip_rules.c
@@ -12,7 +12,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/socket.h>
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # if defined(_KERNEL)
 #  include <sys/libkern.h>
 # else
diff --git a/sys/contrib/ipfilter/netinet/ip_state.c b/sys/contrib/ipfilter/netinet/ip_state.c
index a050a2d324d2..0ebebb49297d 100644
--- a/sys/contrib/ipfilter/netinet/ip_state.c
+++ b/sys/contrib/ipfilter/netinet/ip_state.c
@@ -19,7 +19,7 @@
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/file.h>
-#if defined(_KERNEL) && defined(__FreeBSD_version) && \
+#if defined(_KERNEL) && defined(__FreeBSD__) && \
     !defined(KLD_MODULE)
 #include "opt_inet6.h"
 #endif
@@ -31,7 +31,7 @@
 # include <sys/uio.h>
 # undef _KERNEL
 #endif
-#if defined(_KERNEL) && defined(__FreeBSD_version)
+#if defined(_KERNEL) && defined(__FreeBSD__)
 # include <sys/filio.h>
 # include <sys/fcntl.h>
 #else
@@ -82,7 +82,7 @@
 #ifdef	USE_INET6
 #include <netinet/icmp6.h>
 #endif
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 # include <sys/malloc.h>
 # if defined(_KERNEL) && !defined(IPFILTER_LKM)
 #  include <sys/libkern.h>
@@ -307,7 +307,7 @@ ipf_state_seed_alloc(u_int state_size, u_int state_max)
 		/*
 		 * XXX - ipf_state_seed[X] should be a random number of sorts.
 		 */
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 		state_seed[i] = arc4random();
 #else
 		state_seed[i] = ((u_long)state_seed + i) * state_size;
diff --git a/sys/contrib/ipfilter/netinet/ip_sync.c b/sys/contrib/ipfilter/netinet/ip_sync.c
index f95cd824544b..66bf88e877f0 100644
--- a/sys/contrib/ipfilter/netinet/ip_sync.c
+++ b/sys/contrib/ipfilter/netinet/ip_sync.c
@@ -30,14 +30,14 @@
 #  include <sys/mbuf.h>
 # endif
 # include <sys/select.h>
-# ifdef __FreeBSD_version
+# ifdef __FreeBSD__
 #  include <sys/selinfo.h>
 # endif
 #endif
 #if defined(__NetBSD__) && (__NetBSD_Version__ >= 104000000)
 # include <sys/proc.h>
 #endif
-#if defined(_KERNEL) && defined(__FreeBSD_version)
+#if defined(_KERNEL) && defined(__FreeBSD__)
 # include <sys/filio.h>
 # include <sys/fcntl.h>
 #else
@@ -79,7 +79,7 @@
 #ifdef  USE_INET6
 #include <netinet/icmp6.h>
 #endif
-#if defined(__FreeBSD_version)
+#if defined(__FreeBSD__)
 # include <sys/malloc.h>
 # if defined(_KERNEL) && !defined(IPFILTER_LKM)
 #  include <sys/libkern.h>
diff --git a/sys/contrib/ipfilter/netinet/mlfk_ipl.c b/sys/contrib/ipfilter/netinet/mlfk_ipl.c
index 1f4daf28824d..6e49ef77b486 100644
--- a/sys/contrib/ipfilter/netinet/mlfk_ipl.c
+++ b/sys/contrib/ipfilter/netinet/mlfk_ipl.c
@@ -22,7 +22,7 @@
 #include <sys/socket.h>
 #include <sys/sysctl.h>
 #include <sys/select.h>
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 # include <sys/selinfo.h>
 # include <sys/jail.h>
 # ifdef _KERNEL
@@ -52,7 +52,7 @@
 VNET_DECLARE(ipf_main_softc_t, ipfmain);
 #define	V_ipfmain		VNET(ipfmain)
 
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 static struct cdev *ipf_devs[IPL_LOGSIZE];
 #else
 static dev_t ipf_devs[IPL_LOGSIZE];
@@ -68,7 +68,7 @@ static int ipf_modunload(void);
 static int ipf_fbsd_sysctl_create(void);
 static int ipf_fbsd_sysctl_destroy(void);
 
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 static	int	ipfopen(struct cdev*, int, int, struct thread *);
 static	int	ipfclose(struct cdev*, int, int, struct thread *);
 static	int	ipfread(struct cdev*, struct uio *, int);
@@ -135,7 +135,7 @@ SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmain.ip
 
 #define CDEV_MAJOR 79
 #include <sys/poll.h>
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 # include <sys/select.h>
 static int ipfpoll(struct cdev *dev, int events, struct thread *td);
 
@@ -417,7 +417,7 @@ sysctl_ipf_int_frag ( SYSCTL_HANDLER_ARGS )
 
 
 static int
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 ipfpoll(struct cdev *dev, int events, struct thread *td)
 #else
 ipfpoll(dev_t dev, int events, struct proc *td)
@@ -470,7 +470,7 @@ ipfpoll(dev_t dev, int events, struct proc *td)
  * routines below for saving IP headers to buffer
  */
 static int ipfopen(dev, flags
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 , devtype, p)
 	int devtype;
 	struct thread *p;
@@ -510,7 +510,7 @@ static int ipfopen(dev, flags
 
 
 static int ipfclose(dev, flags
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 , devtype, p)
 	int devtype;
 	struct thread *p;
@@ -538,7 +538,7 @@ static int ipfclose(dev, flags
  */
 static int ipfread(dev, uio, ioflag)
 	int ioflag;
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 	struct cdev *dev;
 #else
 	dev_t dev;
@@ -581,7 +581,7 @@ static int ipfread(dev, uio, ioflag)
  */
 static int ipfwrite(dev, uio, ioflag)
 	int ioflag;
-#ifdef __FreeBSD_version
+#ifdef __FreeBSD__
 	struct cdev *dev;
 #else
 	dev_t dev;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102090036.1190awOp087118>