aboutsummaryrefslogtreecommitdiff
path: root/libxsd/xsd/cxx/tree
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-10-14 12:53:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-10-14 12:53:07 +0200
commit55dcf927a8d8842d20a9654de774847109bc3955 (patch)
tree81841398b9a4988a47462ea8035057735aa2d267 /libxsd/xsd/cxx/tree
parent843baffae450aa8ea3d91b3f888940224d56e211 (diff)
Work around XDR interface differences on BSD-derived systems
Diffstat (limited to 'libxsd/xsd/cxx/tree')
-rw-r--r--libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx14
-rw-r--r--libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx12
2 files changed, 25 insertions, 1 deletions
diff --git a/libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx b/libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx
index 857d914..0cfb9a1 100644
--- a/libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx
+++ b/libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx
@@ -9,6 +9,18 @@
#include <rpc/types.h>
#include <rpc/xdr.h>
+// Of course BSD has to be different and name its functions xdr_u_intXX
+// instead of xdr_uintXX.
+//
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+# if !defined(XSD_CXX_TREE_ASSUME_SUN_XDR) && !defined(xdr_uint8_t)
+# define xdr_uint8_t xdr_u_int8_t
+# define xdr_uint16_t xdr_u_int16_t
+# define xdr_uint32_t xdr_u_int32_t
+# define xdr_uint64_t xdr_u_int64_t
+# endif
+#endif
+
#include <string>
#include <xsd/cxx/tree/buffer.hxx>
@@ -249,7 +261,7 @@ namespace xsd
// Dangerous but fast.
//
x.clear ();
-
+
if (n != 0)
{
x.resize (n);
diff --git a/libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx b/libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx
index 3bdedc6..48834eb 100644
--- a/libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx
+++ b/libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx
@@ -9,6 +9,18 @@
#include <rpc/types.h>
#include <rpc/xdr.h>
+// Of course BSD has to be different and name its functions xdr_u_intXX
+// instead of xdr_uintXX.
+//
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+# if !defined(XSD_CXX_TREE_ASSUME_SUN_XDR) && !defined(xdr_uint8_t)
+# define xdr_uint8_t xdr_u_int8_t
+# define xdr_uint16_t xdr_u_int16_t
+# define xdr_uint32_t xdr_u_int32_t
+# define xdr_uint64_t xdr_u_int64_t
+# endif
+#endif
+
#include <string>
#include <xsd/cxx/tree/buffer.hxx>