summaryrefslogtreecommitdiff
path: root/src/common_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common_interface.c')
-rw-r--r--src/common_interface.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/common_interface.c b/src/common_interface.c
index 0cdf25d..8808fdf 100644
--- a/src/common_interface.c
+++ b/src/common_interface.c
@@ -52,10 +52,20 @@
#endif /* linux */
#elif defined(__sun)
-#define LETOH_16(x) (x)
-#define HTOLE_16(x) (x)
-#define LETOH_32(x) (x)
-#define HTOLE_32(x) (x)
+
+#include <sys/byteorder.h>
+
+#ifdef _BIG_ENDIAN
+# define LETOH_16(x) BSWAP_16(x)
+# define HTOLE_16(x) BSWAP_16(x)
+# define LETOH_32(x) BSWAP_32(x)
+# define HTOLE_32(x) BSWAP_32(x)
+#else
+# define LETOH_16(x) (x)
+# define HTOLE_16(x) (x)
+# define LETOH_32(x) (x)
+# define HTOLE_32(x) (x)
+#endif /* Solaris */
#else