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