Introduce bswap.h for portable definitions of byte swap macros.

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Thomas Klausner 2016-03-03 12:16:57 +01:00 committed by Takashi Iwai
parent 25e6b5b473
commit e0d52fdd8a
18 changed files with 56 additions and 17 deletions

View file

@ -59,7 +59,7 @@ alsainclude_HEADERS += alisp.h
endif
noinst_HEADERS = alsa sys.h search.h list.h aserver.h local.h alsa-symbols.h \
asoundlib-head.h asoundlib-tail.h type_compat.h
asoundlib-head.h asoundlib-tail.h bswap.h type_compat.h
DISTCLEANFILES = stamp-vh version.h alsa asoundlib.h

39
include/bswap.h Normal file
View file

@ -0,0 +1,39 @@
/*
* ALSA lib - compatibility header for providing byte swapping macros
* Copyright (c) 2016 by Thomas Klausner <wiz@NetBSD.org>
*
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __BSWAP_H
#define __BSWAP_H
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
#include <sys/endian.h>
#define bswap_16 bswap16
#define bswap_32 bswap32
#define bswap_64 bswap64
#elif defined (__sun)
#include <sys/byteorder.h>
#define bswap_16 BSWAP_16
#define bswap_32 BSWAP_32
#define bswap_64 BSWAP_64
#else
#include <byteswap.h>
#endif
#endif

View file

@ -56,7 +56,7 @@ IMA compatibility project proceedings, Vol 2, Issue 2, May 1992.
come across a good description of XA yet.
*/
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"
#include "pcm_plugin.h"

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"
#include "pcm_plugin.h"

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"
#include "pcm_plugin.h"

View file

@ -125,7 +125,7 @@ static void mix_select_callbacks(snd_pcm_direct_t *dmix)
(1ULL << SND_PCM_FORMAT_S24_LE) | (1ULL << SND_PCM_FORMAT_S24_3LE) | \
(1ULL << SND_PCM_FORMAT_U8))
#include <byteswap.h>
#include "bswap.h"
static void generic_mix_areas_16_native(unsigned int size,
volatile signed short *dst,

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include <ctype.h>
#include <string.h>
#include "pcm_local.h"

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"
#include "pcm_plugin.h"

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"
#include "pcm_plugin.h"

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"
#include "pcm_plugin.h"

View file

@ -27,7 +27,7 @@
*/
#include <byteswap.h>
#include "bswap.h"
#include <time.h>
#include <pthread.h>
#include <dlfcn.h>

View file

@ -23,7 +23,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"
#include "pcm_plugin.h"

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include <limits.h>
#include "pcm_local.h"
#include "pcm_plugin.h"

View file

@ -28,7 +28,7 @@
*
*/
#include <inttypes.h>
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"
#include "pcm_plugin.h"
#include "pcm_rate.h"

View file

@ -21,7 +21,7 @@
*/
#include <inttypes.h>
#include <byteswap.h>
#include "bswap.h"
#include "pcm_local.h"
#include "pcm_plugin.h"
#include "pcm_rate.h"

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include <math.h>
#include "pcm_local.h"
#include "pcm_plugin.h"

View file

@ -26,7 +26,7 @@
*
*/
#include <byteswap.h>
#include "bswap.h"
#include <math.h>
#include "pcm_local.h"
#include "pcm_plugin.h"