1 /* 2 * ALSA lib - compatibility header for providing byte swapping macros 3 * Copyright (c) 2016 by Thomas Klausner <wiz@NetBSD.org> 4 * 5 * 6 * This library is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU Lesser General Public License as 8 * published by the Free Software Foundation; either version 2.1 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 * 20 */ 21 22 #ifndef __BSWAP_H 23 #define __BSWAP_H 24 25 #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) 26 #include <sys/endian.h> 27 #define bswap_16 bswap16 28 #define bswap_32 bswap32 29 #define bswap_64 bswap64 30 #elif defined (__sun) 31 #include <sys/byteorder.h> 32 #define bswap_16 BSWAP_16 33 #define bswap_32 BSWAP_32 34 #define bswap_64 BSWAP_64 35 #else 36 #include <byteswap.h> 37 #endif 38 39 #endif 40