Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Mar 2010 11:27:39 +0000 (UTC)
From:      Luigi Rizzo <luigi@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r204866 - head/sys/netinet/ipfw/test
Message-ID:  <201003081127.o28BRdRH078153@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: luigi
Date: Mon Mar  8 11:27:39 2010
New Revision: 204866
URL: http://svn.freebsd.org/changeset/base/204866

Log:
  cosmetic changes and C++ compatibility

Modified:
  head/sys/netinet/ipfw/test/dn_test.h

Modified: head/sys/netinet/ipfw/test/dn_test.h
==============================================================================
--- head/sys/netinet/ipfw/test/dn_test.h	Mon Mar  8 11:27:08 2010	(r204865)
+++ head/sys/netinet/ipfw/test/dn_test.h	Mon Mar  8 11:27:39 2010	(r204866)
@@ -6,6 +6,11 @@
 
 #ifndef _DN_TEST_H
 #define _DN_TEST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -24,7 +29,9 @@ extern int debug;
         if (debug > lev) D(fmt, ## args); } while (0)
 
 
+#ifndef offsetof
 #define offsetof(t,m) (int)((&((t *)0L)->m))
+#endif
 
 #include <mylist.h>
 
@@ -45,6 +52,7 @@ enum	{
 struct dn_id {
 	int type, subtype, len, id;
 };
+
 struct dn_fs {
 	int par[4];	/* flowset parameters */
 
@@ -65,8 +73,10 @@ struct dn_fs {
 	 */
 	int	cur;
 };
+
 struct dn_sch {
 };
+
 struct dn_flow {
 	struct dn_id oid;
 	int length;
@@ -76,6 +86,7 @@ struct dn_flow {
 	uint32_t flow_id;
 	struct list_head h;	/* used by the generator */
 };
+
 struct dn_link {
 };
 
@@ -98,12 +109,15 @@ struct ipfw_flow_id {
 };
 
 typedef void * module_t;
+
 struct _md_t {
 	const char *name;
 	int (*f)(module_t, int, void *);
 	void *p;
 };
+
 typedef struct _md_t moduledata_t;
+
 #define DECLARE_MODULE(name, b, c, d)	\
 	moduledata_t *_g_##name = & b
 #define MODULE_DEPEND(a, b, c, d, e)
@@ -154,4 +168,8 @@ mq_append(struct mq *q, struct mbuf *m)
         m->m_nextpkt = NULL;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _DN_TEST_H */



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