Module Name:    src
Committed By:   plunky
Date:           Tue Jun  1 08:53:20 UTC 2010

Modified Files:
        src/dist/ipf: ip_fil.c
        src/sys/dist/ipf/netinet: ip_compat.h ip_fil_netbsd.c

Log Message:
handle STDC and GNUC inline semantic differences by providing and
using an EXTERN_INLINE definition for functions that are defined as
inline but provide an externally callable reference.

(these are externally called in ipftest)


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/dist/ipf/ip_fil.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dist/ipf/netinet/ip_compat.h
cvs rdiff -u -r1.54 -r1.55 src/sys/dist/ipf/netinet/ip_fil_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/dist/ipf/ip_fil.c
diff -u src/dist/ipf/ip_fil.c:1.18 src/dist/ipf/ip_fil.c:1.19
--- src/dist/ipf/ip_fil.c:1.18	Sat Apr 17 21:00:08 2010
+++ src/dist/ipf/ip_fil.c	Tue Jun  1 08:53:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil.c,v 1.18 2010/04/17 21:00:08 darrenr Exp $	*/
+/*	$NetBSD: ip_fil.c,v 1.19 2010/06/01 08:53:20 plunky Exp $	*/
 
 /*
  * Copyright (C) 1993-2001 by Darren Reed.
@@ -709,7 +709,7 @@
 /*                                                                          */
 /* Returns the next IPv4 ID to use for this packet.                         */
 /* ------------------------------------------------------------------------ */
-INLINE u_short fr_nextipid(fin)
+EXTERN_INLINE u_short fr_nextipid(fin)
 fr_info_t *fin;
 {
 	static u_short ipid = 0;
@@ -723,7 +723,7 @@
 }
 
 
-INLINE void fr_checkv4sum(fin)
+EXTERN_INLINE void fr_checkv4sum(fin)
 fr_info_t *fin;
 {
 	if (fr_checkl4sum(fin) == -1)
@@ -732,7 +732,7 @@
 
 
 #ifdef	USE_INET6
-INLINE void fr_checkv6sum(fin)
+EXTERN_INLINE void fr_checkv6sum(fin)
 fr_info_t *fin;
 {
 	if (fr_checkl4sum(fin) == -1)

Index: src/sys/dist/ipf/netinet/ip_compat.h
diff -u src/sys/dist/ipf/netinet/ip_compat.h:1.28 src/sys/dist/ipf/netinet/ip_compat.h:1.29
--- src/sys/dist/ipf/netinet/ip_compat.h:1.28	Sat Apr 17 21:00:44 2010
+++ src/sys/dist/ipf/netinet/ip_compat.h	Tue Jun  1 08:53:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_compat.h,v 1.28 2010/04/17 21:00:44 darrenr Exp $	*/
+/*	$NetBSD: ip_compat.h,v 1.29 2010/06/01 08:53:20 plunky Exp $	*/
 
 /*
  * Copyright (C) 1993-2001, 2003 by Darren Reed.
@@ -1581,6 +1581,14 @@
 # define	INLINE	__inline__
 #endif
 
+#ifndef EXTERN_INLINE
+# if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
+#  define	EXTERN_INLINE	inline
+# else
+#  define	EXTERN_INLINE	extern inline
+# endif
+#endif
+
 #if defined(linux) && defined(_KERNEL)
 extern	void	ipf_read_enter __P((ipfrwlock_t *));
 extern	void	ipf_write_enter __P((ipfrwlock_t *));

Index: src/sys/dist/ipf/netinet/ip_fil_netbsd.c
diff -u src/sys/dist/ipf/netinet/ip_fil_netbsd.c:1.54 src/sys/dist/ipf/netinet/ip_fil_netbsd.c:1.55
--- src/sys/dist/ipf/netinet/ip_fil_netbsd.c:1.54	Sat Apr 17 21:00:44 2010
+++ src/sys/dist/ipf/netinet/ip_fil_netbsd.c	Tue Jun  1 08:53:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil_netbsd.c,v 1.54 2010/04/17 21:00:44 darrenr Exp $	*/
+/*	$NetBSD: ip_fil_netbsd.c,v 1.55 2010/06/01 08:53:20 plunky Exp $	*/
 
 /*
  * Copyright (C) 1993-2003 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.54 2010/04/17 21:00:44 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.55 2010/06/01 08:53:20 plunky Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c	2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 2.55.2.67 2009/12/19 05:41:08 darrenr Exp";
@@ -1817,7 +1817,7 @@
 }
 
 
-INLINE void fr_checkv4sum(fin)
+EXTERN_INLINE void fr_checkv4sum(fin)
 fr_info_t *fin;
 {
 #ifdef M_CSUM_TCP_UDP_BAD
@@ -1891,7 +1891,7 @@
 
 
 #ifdef USE_INET6
-INLINE void fr_checkv6sum(fin)
+EXTERN_INLINE void fr_checkv6sum(fin)
 fr_info_t *fin;
 {
 # ifdef M_CSUM_TCP_UDP_BAD

Reply via email to