]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Introduce bswap.h for portable definitions of byte swap macros.
authorThomas Klausner <wiz@NetBSD.org>
Thu, 3 Mar 2016 11:16:57 +0000 (12:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 3 Mar 2016 15:18:10 +0000 (16:18 +0100)
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
18 files changed:
include/Makefile.am
include/bswap.h [new file with mode: 0644]
src/pcm/pcm_adpcm.c
src/pcm/pcm_alaw.c
src/pcm/pcm_copy.c
src/pcm/pcm_dmix_generic.c
src/pcm/pcm_file.c
src/pcm/pcm_iec958.c
src/pcm/pcm_lfloat.c
src/pcm/pcm_linear.c
src/pcm/pcm_meter.c
src/pcm/pcm_misc.c
src/pcm/pcm_mulaw.c
src/pcm/pcm_null.c
src/pcm/pcm_rate.c
src/pcm/pcm_rate_linear.c
src/pcm/pcm_route.c
src/pcm/pcm_softvol.c

index 8c83c11d3e40722d499c442077d1c2d984c55637..31a3f748dc460673f8db986c32307cc60b745c92 100644 (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
 
diff --git a/include/bswap.h b/include/bswap.h
new file mode 100644 (file)
index 0000000..68adce3
--- /dev/null
@@ -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
index 1a83c5a0e21ca9fcf99e18d20ecbe761b914a51e..1c88c83787851ccb7fb4a57b3dc590b77cb36adc 100644 (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"
 
index db759e3effa489bf232482b33701bbded6160088..fa58441cf4b004052cd21b68f15af7a309384eaf 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
   
-#include <byteswap.h>
+#include "bswap.h"
 #include "pcm_local.h"
 #include "pcm_plugin.h"
 
index 66d3a4719856d8d687ca77f5f3a3a9c1cf08bc02..0dbd5bd00fc1f79287e770c33c62710a37e893b5 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
   
-#include <byteswap.h>
+#include "bswap.h"
 #include "pcm_local.h"
 #include "pcm_plugin.h"
 
index 9e9d3c3cf66402bd10d73a23eb42aedca04d8e31..40c08747a74a4676a7de460e42dd5217afdc45fc 100644 (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,
index 9ab6964d3520b42fa317e4f66b4820522a7f2e3f..92eb0724c0e25144ea056b82f154112774cf2588 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
   
-#include <byteswap.h>
+#include "bswap.h"
 #include <ctype.h>
 #include <string.h>
 #include "pcm_local.h"
index 38c4ce7e2421cdc55d61cbfbf2a4dab51726854b..86ac9cfd802cff3ba5fa4d03b926e43b2fa8efc7 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
   
-#include <byteswap.h>
+#include "bswap.h"
 #include "pcm_local.h"
 #include "pcm_plugin.h"
 
index 2f3e578fc5034244ff59d6aa2f711da79e2dfe79..22201f84c9af02bef03fd2e292873b4a98a29398 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
   
-#include <byteswap.h>
+#include "bswap.h"
 #include "pcm_local.h"
 #include "pcm_plugin.h"
 
index 9a92abd04fb8f4c85e3e838e63d9e15edfcc6949..50df7794783f74af28661f13047fa971712fbe02 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
   
-#include <byteswap.h>
+#include "bswap.h"
 #include "pcm_local.h"
 #include "pcm_plugin.h"
 
index 034f582564a8ab81991e2537a6c96e1706d060f2..1b0ccb40b3dd005df47380c7b53dadbca7f19e09 100644 (file)
@@ -27,7 +27,7 @@
  */
   
 
-#include <byteswap.h>
+#include "bswap.h"
 #include <time.h>
 #include <pthread.h>
 #include <dlfcn.h>
index 5870f82c0b4c58012dcbe484cff94a40dd92276c..7d2b05db1c3f041264a4b5fd6074bb3b0c77b58f 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <byteswap.h>
+#include "bswap.h"
 #include "pcm_local.h"
 
 
index 011b2a516be0a9e3e2d99f459a2bea62d88acb9d..15dbdc1ceecf6d8c774d26834a72a7d58c6b0448 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
   
-#include <byteswap.h>
+#include "bswap.h"
 #include "pcm_local.h"
 #include "pcm_plugin.h"
 
index 5e63caaeec53f4c673d986c167d8f4a1356c0955..685618e83c8b5cd45a92dfd7a99b74d027ff44c1 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
   
-#include <byteswap.h>
+#include "bswap.h"
 #include <limits.h>
 #include "pcm_local.h"
 #include "pcm_plugin.h"
index c76db25b1183853d4de5144251168215c875421c..41bddac1a83f27c708652a9873a966621a2022c1 100644 (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"
index 7481b389726a8ee41bc772751a6cf0a01933f0f5..70399e0d8bdaf98d67ecf76e0dc4bbf46a2df324 100644 (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"
index 646517d2a9d25e8eb8177e49a36ed7fd9f601687..361160302be87d48469cf248bb74f4215f0c4680 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
   
-#include <byteswap.h>
+#include "bswap.h"
 #include <math.h>
 #include "pcm_local.h"
 #include "pcm_plugin.h"
index c6cfd8896b26ddf132eccc72d0739ca1b46ac25b..802aa4b7cb68e444b8b47e7140870141aad65ffc 100644 (file)
@@ -26,7 +26,7 @@
  *
  */
 
-#include <byteswap.h>
+#include "bswap.h"
 #include <math.h>
 #include "pcm_local.h"
 #include "pcm_plugin.h"