diff options
-rw-r--r-- | libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx | 14 | ||||
-rw-r--r-- | libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx | 12 |
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> |