summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-16 16:59:30 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-16 16:59:30 -0700
commitb2f6eab4027beaaa7415e70dad269bdc7cc27722 (patch)
tree2e6088ca17b4042ccf9c658148cd5af55021c8a1 /compat
parent06316234accdcb6608506aed6600cd60ff5c5c8e (diff)
parentfbcda3c0a72cbcc105100ebef1b1dae54d854204 (diff)
downloadgit-b2f6eab4027beaaa7415e70dad269bdc7cc27722.tar.gz
Merge branch 'maint'
* maint: Prepare draft release notes to 1.7.4.2 gitweb: highlight: replace tabs with spaces make_absolute_path: return the input path if it points to our buffer valgrind: ignore SSE-based strlen invalid reads diff --submodule: split into bite-sized pieces cherry: split off function to print output lines branch: split off function that writes tracking info and commit subject standardize brace placement in struct definitions compat: make gcc bswap an inline function enums: omit trailing comma for portability Conflicts: RelNotes
Diffstat (limited to 'compat')
-rw-r--r--compat/bswap.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/compat/bswap.h b/compat/bswap.h
index 54756dbb05..5061214f73 100644
--- a/compat/bswap.h
+++ b/compat/bswap.h
@@ -21,14 +21,16 @@ static inline uint32_t default_swab32(uint32_t val)
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
-#define bswap32(x) ({ \
- uint32_t __res; \
- if (__builtin_constant_p(x)) { \
- __res = default_swab32(x); \
- } else { \
- __asm__("bswap %0" : "=r" (__res) : "0" ((uint32_t)(x))); \
- } \
- __res; })
+#define bswap32 git_bswap32
+static inline uint32_t git_bswap32(uint32_t x)
+{
+ uint32_t result;
+ if (__builtin_constant_p(x))
+ result = default_swab32(x);
+ else
+ __asm__("bswap %0" : "=r" (result) : "0" (x));
+ return result;
+}
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))