Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src handle STDC and GNUC inline semantic differences by providin...



details:   https://anonhg.NetBSD.org/src/rev/378f11e522b9
branches:  trunk
changeset: 755318:378f11e522b9
user:      plunky <plunky%NetBSD.org@localhost>
date:      Tue Jun 01 08:53:20 2010 +0000

description:
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)

diffstat:

 dist/ipf/ip_fil.c                    |   8 ++++----
 sys/dist/ipf/netinet/ip_compat.h     |  10 +++++++++-
 sys/dist/ipf/netinet/ip_fil_netbsd.c |   8 ++++----
 3 files changed, 17 insertions(+), 9 deletions(-)

diffs (96 lines):

diff -r 12dd5db8d402 -r 378f11e522b9 dist/ipf/ip_fil.c
--- a/dist/ipf/ip_fil.c Tue Jun 01 08:42:56 2010 +0000
+++ b/dist/ipf/ip_fil.c Tue Jun 01 08:53:20 2010 +0000
@@ -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)
diff -r 12dd5db8d402 -r 378f11e522b9 sys/dist/ipf/netinet/ip_compat.h
--- a/sys/dist/ipf/netinet/ip_compat.h  Tue Jun 01 08:42:56 2010 +0000
+++ b/sys/dist/ipf/netinet/ip_compat.h  Tue Jun 01 08:53:20 2010 +0000
@@ -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 *));
diff -r 12dd5db8d402 -r 378f11e522b9 sys/dist/ipf/netinet/ip_fil_netbsd.c
--- a/sys/dist/ipf/netinet/ip_fil_netbsd.c      Tue Jun 01 08:42:56 2010 +0000
+++ b/sys/dist/ipf/netinet/ip_fil_netbsd.c      Tue Jun 01 08:53:20 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index