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