Fix MSVC build
PATCH 1/2 Fix MSVC build
Signed-off-by Peter Harris <[email protected]>
--- compat/mingw.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
compat/mingw.h +2 -0
@@ -14,11 +14,13 @@ typedef int uid_t;#define S_ISSOCK (x) 0#ifndef _STAT_H_ +#ifndef S_IRUSR #define S_IRUSR 0#define S_IWUSR 0#define S_IXUSR 0#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)#endif +#endif #define S_IRGRP 0#define S_IWGRP 0#define S_IXGRP 0
Signature · 1 line
1.7.1.msysgit.0.4.gea744.MSVC
PATCH 2/2 Modify MSVC wrapper script
This reduces warnings, and supports additional linker flags (such as -DEBUG and -MAP)
Signed-off-by Peter Harris <[email protected]>
--- Makefile | 1 + compat/vcbuild/scripts/clink.pl | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletions(-)
Makefile +1 -0
@@ -1073,6 +1073,7 @@ ifndef DEBUG AR += -LTCG else BASIC_CFLAGS += -Zi -MTd + BASIC_LDFLAGS = -DEBUG -MAP endif X = .exe endif
compat/vcbuild/scripts/clink.pl +6 -1
@@ -12,10 +12,14 @@ use strict; my @args = (); my @cflags = (); +my @lflags = (); my $is_linking = 0; +my %linkflag = ( '-DEBUG' => 1, '-MAP' => 1 ); while (@ARGV) { my $arg = shift @ARGV; - if ("$arg" =~ /^-[DIMGO]/) { + if ($linkflag{$arg}) { + push(@lflags, $arg); + } elsif ("$arg" =~ /^-[DIMGOWZ]/) { push(@cflags, $arg); } elsif ("$arg" eq "-o") { my $file_out = shift @ARGV;
@@ -44,6 +48,7 @@ while (@ARGV) { } if ($is_linking) { unshift(@args, "link.exe"); + push(@args, @lflags); } else { unshift(@args, "cl.exe"); push(@args, @cflags);
Signature · 1 line
1.7.1.msysgit.0.4.gea744.MSVC
Am 7/5/2010 21:41, schrieb Peter Harris:
Quoted 13 lines
Signed-off-by Peter Harris <[email protected]>--- compat/mingw.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)compat/mingw.h +0
-0@@ -14,11 +14,13 @@ typedef int uid_t;#define S_ISSOCK (x) 0#ifndef _STAT_H_
compat/mingw.h typedef int uid_t; · line 26
Quoted 10 lines
compat/mingw.h +2
-0+#ifndef S_IRUSR #define S_IRUSR 0#define S_IWUSR 0#define S_IXUSR 0#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)#endif +#endif #define S_IRGRP 0#define S_IWGRP 0#define S_IXGRP 0
This doesn't apply: I don't see the #ifndef _STAT_H_ brackets anywhere in my version of compat/mingw.h.
-- Hannes
Hi,
Quoted 13 lines · Johannes Sixt
Am 7/5/2010 21:41, schrieb Peter Harris:
Quoted 12 lines
Signed-off-by Peter Harris <[email protected]>--- compat/mingw.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)compat/mingw.h +0
-0@@ -14,11 +14,13 @@ typedef int uid_t;#define S_ISSOCK (x) 0
Quoted 14 lines
compat/mingw.h typedef int uid_t; · line 26
Quoted 11 lines
compat/mingw.h +2
-0#ifndef _STAT_H_ +#ifndef S_IRUSR #define S_IRUSR 0#define S_IWUSR 0#define S_IXUSR 0#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)#endif +#endif #define S_IRGRP 0#define S_IWGRP 0#define S_IXGRP 0This doesn't apply: I don't see the #ifndef _STAT_H_ brackets anywhere in my version of
compat/mingw.h.
Obviously, this is a patch against 4msysgit's devel branch.
Hth,
Dscho