c8429d3746
by Vadim Zhukov, diff prepared by Amit Kulkarni
32 lines
983 B
Plaintext
32 lines
983 B
Plaintext
$OpenBSD: patch-libstreams_lib_textutils_cpp,v 1.1 2012/11/15 00:04:30 sthen Exp $
|
|
Do not use home-grown swapXX macros instead of system ones.
|
|
--- libstreams/lib/textutils.cpp.orig Sun Feb 5 17:08:27 2012
|
|
+++ libstreams/lib/textutils.cpp Tue Oct 9 14:07:24 2012
|
|
@@ -163,12 +163,18 @@ Strigi::convertNewLines(char* p) {
|
|
}
|
|
}
|
|
|
|
+#ifndef swap16
|
|
#define swap16(x) \
|
|
((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
|
|
+#endif
|
|
|
|
+#ifndef swap32
|
|
#define swap32(x) \
|
|
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) \
|
|
| (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
|
|
+#endif
|
|
+
|
|
+#ifndef swap64
|
|
#define swap64(x) \
|
|
((((x) & 0xff00000000000000ull) >> 56) \
|
|
| (((x) & 0x00ff000000000000ull) >> 40) \
|
|
@@ -178,6 +184,7 @@ Strigi::convertNewLines(char* p) {
|
|
| (((x) & 0x0000000000ff0000ull) << 24) \
|
|
| (((x) & 0x000000000000ff00ull) << 40) \
|
|
| (((x) & 0x00000000000000ffull) << 56))
|
|
+#endif
|
|
|
|
#ifdef __BIG_ENDIAN__
|
|
int16_t
|