[sink_flac] add missing SWAPS definition (closes gh-407, thanks to @tperale)
authorThomas Perale <thomas.perale@mind.be>
Thu, 19 Sep 2024 16:57:16 +0000 (18:57 +0200)
committerPaul Brossier <piem@piem.org>
Sun, 16 Nov 2025 12:39:40 +0000 (13:39 +0100)
src/io/sink_flac.c

index 0414479..0a1cbc2 100644 (file)
@@ -36,6 +36,9 @@
 
 #define MAX_WRITE_SIZE 4096
 
+// swap endian of a short
+#define SWAPS(x) ((x & 0xff) << 8) | ((x & 0xff00) >> 8)
+
 // swap host to little endian
 #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
 #define HTOLES(x) SWAPS(x)