Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-05-03 08:02:15 +0400
committerJonathan Nieder <jrnieder@gmail.com>2011-05-03 08:02:15 +0400
commit59445b0b02c731872c8665ac7e9cf1226fa616e4 (patch)
tree93922cf13ed9c62859dac628fa7e376977a23d24 /compat/bswap.h
parent6908e999468d7eb531a1609cee37673c5d3ca04f (diff)
parentec014eac0e9e6f30cbbca616090fa2ecf74797e7 (diff)
Merge commit 'v1.7.5' into svn-fe
* commit 'v1.7.5': (436 commits) Git 1.7.5 Git 1.7.5-rc3 Git 1.7.4.5 git-svn.txt: Document --mergeinfo Revert "run-command: prettify -D_FORTIFY_SOURCE workaround" ...
Diffstat (limited to 'compat/bswap.h')
-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))