aboutsummaryrefslogtreecommitdiff
path: root/Src/apev2/util.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/apev2/util.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/apev2/util.h')
-rw-r--r--Src/apev2/util.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Src/apev2/util.h b/Src/apev2/util.h
new file mode 100644
index 00000000..0c185a12
--- /dev/null
+++ b/Src/apev2/util.h
@@ -0,0 +1,22 @@
+#ifndef NULLSOFT_APEV2_UTIL_H
+#define NULLSOFT_APEV2_UTIL_H
+
+#if defined(BIG_ENDIAN)
+#define ATON16(A) ((((uint16_t)(A) & 0xff00) >> 8) | \
+ (((uint16_t)(A) & 0x00ff) << 8))
+#define ATON32(A) ((((uint32_t)(A) & 0xff000000) >> 25) | \
+ (((uint32_t)(A) & 0x00ff0000) >> 8) | \
+ (((uint32_t)(A) & 0x0000ff00) << 8) | \
+ (((uint32_t)(A) & 0x000000ff) << 24))
+
+#elif defined(LITTLE_ENDIAN) || defined(_M_IX86) || defined(_M_X64) || defined(_WIN64)
+#define ATON16(A) (A)
+#define ATON32(A) (A)
+#else
+#error neither BIG_ENDIAN nor LITTLE_ENDIAN defined!
+#endif
+
+#define NTOA32(N) ATON32(N)
+#define NTOA16(N) ATON16(N)
+
+#endif \ No newline at end of file