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
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/bswap.h14
-rw-r--r--compat/vcbuild/scripts/clink.pl2
-rw-r--r--compat/vcbuild/scripts/lib.pl2
3 files changed, 14 insertions, 4 deletions
diff --git a/compat/bswap.h b/compat/bswap.h
index 7246a12c6e..279e0b48b1 100644
--- a/compat/bswap.h
+++ b/compat/bswap.h
@@ -9,7 +9,7 @@
* Default version that the compiler ought to optimize properly with
* constant values.
*/
-static inline unsigned int default_swab32(unsigned int val)
+static inline uint32_t default_swab32(uint32_t val)
{
return (((val & 0xff000000) >> 24) |
((val & 0x00ff0000) >> 8) |
@@ -20,7 +20,7 @@ static inline unsigned int default_swab32(unsigned int val)
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#define bswap32(x) ({ \
- unsigned int __res; \
+ uint32_t __res; \
if (__builtin_constant_p(x)) { \
__res = default_swab32(x); \
} else { \
@@ -28,6 +28,16 @@ static inline unsigned int default_swab32(unsigned int val)
} \
__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)
diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl
index fce1e2423e..8a2112f22f 100644
--- a/compat/vcbuild/scripts/clink.pl
+++ b/compat/vcbuild/scripts/clink.pl
@@ -48,4 +48,4 @@ if ($is_linking) {
push(@args, @cflags);
}
#printf("**** @args\n");
-exit system(@args);
+exit (system(@args) != 0);
diff --git a/compat/vcbuild/scripts/lib.pl b/compat/vcbuild/scripts/lib.pl
index 68f66446ea..d8054e469f 100644
--- a/compat/vcbuild/scripts/lib.pl
+++ b/compat/vcbuild/scripts/lib.pl
@@ -23,4 +23,4 @@ while (@ARGV) {
}
unshift(@args, "lib.exe");
# printf("**** @args\n");
-exit system(@args);
+exit (system(@args) != 0);