1*150a6952SToomas Soome /* 2*150a6952SToomas Soome * This file and its contents are supplied under the terms of the 3*150a6952SToomas Soome * Common Development and Distribution License ("CDDL"), version 1.0. 4*150a6952SToomas Soome * You may only use this file in accordance with the terms of version 5*150a6952SToomas Soome * 1.0 of the CDDL. 6*150a6952SToomas Soome * 7*150a6952SToomas Soome * A full copy of the text of the CDDL should have accompanied this 8*150a6952SToomas Soome * source. A copy of the CDDL is also available via the Internet at 9*150a6952SToomas Soome * http://www.illumos.org/license/CDDL. 10*150a6952SToomas Soome */ 11*150a6952SToomas Soome 12*150a6952SToomas Soome /* 13*150a6952SToomas Soome * Copyright 2016 Toomas Soome <tsoome@me.com> 14*150a6952SToomas Soome */ 15*150a6952SToomas Soome 16*150a6952SToomas Soome #ifndef _ENDIAN_H 17*150a6952SToomas Soome #define _ENDIAN_H 18*150a6952SToomas Soome 19*150a6952SToomas Soome /* 20*150a6952SToomas Soome * Shim to use sys/byteorder.h in case the endian.h is not available. 21*150a6952SToomas Soome */ 22*150a6952SToomas Soome 23*150a6952SToomas Soome #include <sys/byteorder.h> 24*150a6952SToomas Soome 25*150a6952SToomas Soome #ifdef __cplusplus 26*150a6952SToomas Soome extern "C" { 27*150a6952SToomas Soome #endif 28*150a6952SToomas Soome 29*150a6952SToomas Soome #ifndef htole16 30*150a6952SToomas Soome #define htole16 LE_16 31*150a6952SToomas Soome #endif 32*150a6952SToomas Soome #ifndef htole32 33*150a6952SToomas Soome #define htole32 LE_32 34*150a6952SToomas Soome #endif 35*150a6952SToomas Soome #ifndef le16toh 36*150a6952SToomas Soome #define le16toh LE_16 37*150a6952SToomas Soome #endif 38*150a6952SToomas Soome #ifndef le32toh 39*150a6952SToomas Soome #define le32toh LE_32 40*150a6952SToomas Soome #endif 41*150a6952SToomas Soome 42*150a6952SToomas Soome #ifdef __cplusplus 43*150a6952SToomas Soome } 44*150a6952SToomas Soome #endif 45*150a6952SToomas Soome 46*150a6952SToomas Soome #endif /* _ENDIAN_H */ 47