From 9d8b6cd9492deff6747649e0c87f3b7df51b9965 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 15 Dec 2011 13:07:23 +0200 Subject: Additional fixes for BSD XDR compatibility --- libxsd/xsd/cxx/tree/xdr-stream-extraction.hxx | 9 +++++---- libxsd/xsd/cxx/tree/xdr-stream-insertion.hxx | 9 +++++---- 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 #include -// 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 (y)) +# define xdr_uint8_t(x, y) xdr_u_char(x, reinterpret_cast (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 #include -// 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 (y)) +# define xdr_uint8_t(x, y) xdr_u_char(x, reinterpret_cast (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 -- cgit v1.1