threads / patch / 36299

patchMSVC: added missing include so `make INLINE=__inline` is no longer required

Subject: [PATCH] MSVC: added missing include so `make INLINE=__inline` is no longer required

## tl;dr

5 messages between Mar 27, 2014 and Mar 28, 2014. Diffs are folded; open one to read it.

replies: 4people: 2as markdown or json

Marat Radchenko· Mar 27, 2014, 07:34 UTC · lore

[PATCH] MSVC: allow enabling CURL

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
---
 compat/vcbuild/scripts/clink.pl | 2 ++
 config.mak.uname                | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)
Show changes to 2 files +2 −1

compat/vcbuild/scripts/clink.pl, config.mak.uname

diff --git a/compat/vcbuild/scripts/clink.pl b/compat/vcbuild/scripts/clink.pl
index 4374771..a87d0da 100755
--- a/compat/vcbuild/scripts/clink.pl
+++ b/compat/vcbuild/scripts/clink.pl
@@ -33,6 +33,8 @@ while (@ARGV) {
 		push(@args, "libeay32.lib");
 	} elsif ("$arg" eq "-lssl") {
 		push(@args, "ssleay32.lib");
+	} elsif ("$arg" eq "-lcurl") {
+		push(@args, "libcurl.lib");
 	} elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
 		$arg =~ s/^-L/-LIBPATH:/;
 		push(@args, $arg);
diff --git a/config.mak.uname b/config.mak.uname
index 6069a44..cfc2a93 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -340,7 +340,6 @@ ifeq ($(uname_S),Windows)
 	UNRELIABLE_FSTAT = UnfortunatelyYes
 	OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
 	NO_REGEX = YesPlease
-	NO_CURL = YesPlease
 	NO_GETTEXT = YesPlease
 	NO_PYTHON = YesPlease
 	BLK_SHA1 = YesPlease
-- 
1.9.1
Marat Radchenko· Mar 27, 2014, 07:34 UTC · re: Marat Radchenko · lore
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
---
 xdiff/xutils.c | 1 +
 1 file changed, 1 insertion(+)
Show changes to xdiff/xutils.c +1 −0
diff --git a/xdiff/xutils.c b/xdiff/xutils.c
index 62cb23d..a21a835 100644
--- a/xdiff/xutils.c
+++ b/xdiff/xutils.c
@@ -23,6 +23,7 @@
 #include <limits.h>
 #include <assert.h>
 #include "xinclude.h"
+#include "git-compat-util.h"
 
 
 
-- 
1.9.1
Junio C Hamano· Mar 27, 2014, 16:49 UTC · re: Marat Radchenko · lore

Re: [PATCH] MSVC: added missing include so `make INLINE=__inline` is no longer required

Marat Radchenko <marat@slonopotamus.org> writes:
Show 14 quoted lines
> Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
> ---
>  xdiff/xutils.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/xdiff/xutils.c b/xdiff/xutils.c
> index 62cb23d..a21a835 100644
> --- a/xdiff/xutils.c
> +++ b/xdiff/xutils.c
> @@ -23,6 +23,7 @@
>  #include <limits.h>
>  #include <assert.h>
>  #include "xinclude.h"
> +#include "git-compat-util.h"
This is unfortunate for a few reasons:
 - xdiff/* is a borrowed code; we do not want to have (or add more)
   dependencies on the rest of Git, including compat-util.
 - When a piece of our code needs our compatibility support,
   compat-util must be the first header file included (either
   directly, or indirectly by including another header file that
   includes it at the top).

My gut feeling is that adding a mechanism to add -DINLINE=__inline only on MSVC to the top-level Makefile, without touching this file, may be a much more palatable.

I dunno.
Marat Radchenko· Mar 27, 2014, 17:43 UTC · re: Junio C Hamano · lore

Re: [PATCH] MSVC: added missing include so `makeINLINE=__inline` is no longer required

Junio C Hamano <gitster <at> pobox.com> writes:
> My gut feeling is that adding a mechanism to add -DINLINE=__inline
> only on MSVC to the top-level Makefile, without touching this file,
> may be a much more palatable.

Okay, I'll think more about this one. Maybe *moving* inline=__inline from compat-headers into Makefile (actually, config.mak.uname) will work better.

Hope it doesn't prevent first patch from being integrated -- joining them in a single thread was unintentional misuse of `git send-email` flags.

Marat Radchenko· Mar 28, 2014, 07:33 UTC · re: Junio C Hamano · lore

[PATCH v2] MSVC: define INLINE=__inline so simple `make MSVC=1` actually works

Without this, xdiff/xutils.c fails to compile.
Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
---
I thought about removing #define inline __inline from compat/msvc.h but:
 * compat/msvc.h is included based on #if defined(_MSC_VER)
   and can be enabled even if MSVC != 1
 * compat/msvc.h also has #define __inline__ __inline and I don't see
   a nice way to handle both of them in config.mak.uname
 config.mak.uname | 1 +
 1 file changed, 1 insertion(+)
Show changes to config.mak.uname +1 −0
diff --git a/config.mak.uname b/config.mak.uname
index 6c7b904..38c60af 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -355,6 +355,7 @@ ifeq ($(uname_S),Windows)
 	NO_POSIX_GOODIES = UnfortunatelyYes
 	NATIVE_CRLF = YesPlease
 	DEFAULT_HELP_FORMAT = html
+	INLINE = __inline
 
 	CC = compat/vcbuild/scripts/clink.pl
 	AR = compat/vcbuild/scripts/lib.pl
-- 
1.9.1

← back to recent threads