summaryrefslogtreecommitdiffstats
path: root/cddl/compat/opensolaris
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2011-06-10 20:10:30 +0000
committergibbs <gibbs@FreeBSD.org>2011-06-10 20:10:30 +0000
commit58b2f49fd98f001f6fdf400503a96a672a7cbeb9 (patch)
treeb9ceefa1a1a2bae6902b9f392e2e40d97b244f33 /cddl/compat/opensolaris
parentb3addc85e167e6bbf956e072246f0d30c9496ab2 (diff)
downloadFreeBSD-src-58b2f49fd98f001f6fdf400503a96a672a7cbeb9.zip
FreeBSD-src-58b2f49fd98f001f6fdf400503a96a672a7cbeb9.tar.gz
Remove C constructs that are incompatible with C++ from various
OpenSolaris and ZFS header files. These changes are sufficient to allow a C++ program to use the libzfs library. Note: The majority of these files already included 'extern "C"' declarations, so the intention of providing C++ compatibility already existed even if it wasn't provided. cddl/compat/opensolaris/include/assert.h: Wrap our compatibility assert implementation in 'extern "C"'. Since this is a compatibility header I matched the Solaris style of doing this explicitly rather than rely on FreeBSD's __BEGIN/END_DECLS macro. sys/cddl/compat/opensolaris/sys/kstat.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h: Rename parameters in function declarations that conflict with C++ keywords. This was the solution preferred by members of the Illumos community. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h: In C, nested structures are visible in the global namespace, but in C++, they take on the namespace of the structure in which they are contained. Flatten nested structure definitions within struct zfs_cmd so these structures are visible in the global namespace when compiled in both languages. Sponsored by: Spectra Logic Corporation
Diffstat (limited to 'cddl/compat/opensolaris')
-rw-r--r--cddl/compat/opensolaris/include/assert.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cddl/compat/opensolaris/include/assert.h b/cddl/compat/opensolaris/include/assert.h
index 353f0c9..0887093 100644
--- a/cddl/compat/opensolaris/include/assert.h
+++ b/cddl/compat/opensolaris/include/assert.h
@@ -43,6 +43,10 @@
#include <stdio.h>
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static __inline void
__assert(const char *expr, const char *file, int line)
{
@@ -52,4 +56,9 @@ __assert(const char *expr, const char *file, int line)
abort();
/* NOTREACHED */
}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_ASSERT_H_ */
OpenPOWER on IntegriCloud