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

5 messages from 2014-03-27 to 2014-03-28. Participants: Marat Radchenko, Junio C Hamano.
Thread: https://gitlist.dev/t/36299

## Marat Radchenko, 2014-03-27 07:34

Subject: [PATCH] MSVC: allow enabling CURL
Message-ID: <1395905668-32005-1-git-send-email-marat@slonopotamus.org>
URL: https://gitlist.dev/e/1395905668-32005-1-git-send-email-marat%40slonopotamus.org

```
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(-)

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, 2014-03-27 07:34

Subject: [PATCH] MSVC: added missing include so `make INLINE=__inline` is no longer required
Message-ID: <1395905668-32005-2-git-send-email-marat@slonopotamus.org>
URL: https://gitlist.dev/e/1395905668-32005-2-git-send-email-marat%40slonopotamus.org
In-Reply-To: <1395905668-32005-1-git-send-email-marat@slonopotamus.org>

```
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"
 
 
 
-- 
1.9.1

```

## Junio C Hamano, 2014-03-27 16:49

Subject: Re: [PATCH] MSVC: added missing include so `make INLINE=__inline` is no longer required
Message-ID: <xmqqzjkbegdt.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqzjkbegdt.fsf%40gitster.dls.corp.google.com
In-Reply-To: <1395905668-32005-2-git-send-email-marat@slonopotamus.org>

```
Marat Radchenko <marat@slonopotamus.org> writes:

> 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, 2014-03-27 17:43

Subject: Re: [PATCH] MSVC: added missing include so `makeINLINE=__inline` is no longer required
Message-ID: <loom.20140327T183247-442@post.gmane.org>
URL: https://gitlist.dev/e/loom.20140327T183247-442%40post.gmane.org
In-Reply-To: <xmqqzjkbegdt.fsf@gitster.dls.corp.google.com>

```
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, 2014-03-28 07:33

Subject: [PATCH v2] MSVC: define INLINE=__inline so simple `make MSVC=1` actually works
Message-ID: <1395992031-27200-1-git-send-email-marat@slonopotamus.org>
URL: https://gitlist.dev/e/1395992031-27200-1-git-send-email-marat%40slonopotamus.org
In-Reply-To: <xmqqzjkbegdt.fsf@gitster.dls.corp.google.com>

```
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(+)

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

```
