summaryrefslogtreecommitdiff
path: root/libxsd
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-12-15 13:07:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-12-15 13:07:23 +0200
commit9d8b6cd9492deff6747649e0c87f3b7df51b9965 (patch)
treeb7b52ddcd81de66a5acf1275d405df20b2fd35cd /libxsd
parent55dcf927a8d8842d20a9654de774847109bc3955 (diff)
Additional fixes for BSD XDR compatibility
Diffstat (limited to 'libxsd')
-rw-r--r--libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx9
-rw-r--r--libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx9
2 files changed, 10 insertions, 8 deletions
diff --git a/libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx b/libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx
index 0cfb9a1..0e4b8f7 100644
--- a/libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx
+++ b/libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx
@@ -9,12 +9,13 @@
#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.
+// Of course BSD has to be different and name its functions u_intXX
+// instead of uintXX. Plus it does not have XX == 8.
//
#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
+# if !defined(XSD_CXX_TREE_ASSUME_SUN_XDR) && !defined(xdr_int8_t)
+# define xdr_int8_t(x, y) xdr_char(x, reinterpret_cast<char*> (y))
+# define xdr_uint8_t(x, y) xdr_u_char(x, reinterpret_cast<unsigned char*> (y))
# define xdr_uint16_t xdr_u_int16_t
# define xdr_uint32_t xdr_u_int32_t
# define xdr_uint64_t xdr_u_int64_t
diff --git a/libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx b/libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx
index 48834eb..fadc97b 100644
--- a/libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx
+++ b/libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx
@@ -9,12 +9,13 @@
#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.
+// Of course BSD has to be different and name its functions u_intXX
+// instead of uintXX. Plus it does not have XX == 8.
//
#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
+# if !defined(XSD_CXX_TREE_ASSUME_SUN_XDR) && !defined(xdr_int8_t)
+# define xdr_int8_t(x, y) xdr_char(x, reinterpret_cast<char*> (y))
+# define xdr_uint8_t(x, y) xdr_u_char(x, reinterpret_cast<unsigned char*> (y))
# define xdr_uint16_t xdr_u_int16_t
# define xdr_uint32_t xdr_u_int32_t
# define xdr_uint64_t xdr_u_int64_t