summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cd0f8e6)
raw | patch | inline | side by side (parent: cd0f8e6)
author | Sebastian Schuberth <sschuberth@gmail.com> | |
Mon, 19 Oct 2009 16:37:05 +0000 (18:37 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 30 Oct 2009 16:37:48 +0000 (09:37 -0700) |
When compiling with MSVC on x86-compatible, use an intrinsic for byte swapping.
In contrast to the GCC path, we do not prefer inline assembly here as it is not
supported for the x64 platform.
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
In contrast to the GCC path, we do not prefer inline assembly here as it is not
supported for the x64 platform.
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/bswap.h | patch | blob | history |
diff --git a/compat/bswap.h b/compat/bswap.h
index 5cc4acbfccef771769974b9f7cd8f6bca9321354..279e0b48b15e091fc0ca975c3efbd461ab02c149 100644 (file)
--- a/compat/bswap.h
+++ b/compat/bswap.h
} \
__res; })
+#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
+
+#include <stdlib.h>
+
+#define bswap32(x) _byteswap_ulong(x)
+
+#endif
+
+#ifdef bswap32
+
#undef ntohl
#undef htonl
#define ntohl(x) bswap32(x)