threads / patch / 20615

patchRe: [PATCH] Enable Visual Studio 2008 Build Git

Subject: Re: [PATCH] Enable Visual Studio 2008 Build Git

## tl;dr

One message between Aug 16, 2009 and Aug 16, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Dmitry Potapov· Aug 16, 2009, 10:49 UTC · lore
Hi,
In addition to what Johannes wrote above, I have a few more remarks:
On Tue, Aug 04, 2009 at 11:53:38PM +0800, Frank Li wrote:
> diff --git a/compat/mingw.c b/compat/mingw.c
[...]
Show 8 quoted lines
> @@ -1011,7 +1021,9 @@ static sig_handler_t timer_fn = SIG_DFL;
>   * But ticktack() interrupts the wait state after the timer's interval
>   * length to call the signal handler.
>   */
> -
> +#if defined(_MSC_VER)
> +#define __stdcall
> +#endif

It is a very dirty hack to change __stdcall in this way, and more importantly, it is not clear why you did this.

>  static __stdcall unsigned ticktack(void *dummy)

Accordingly to MSDN: http://msdn.microsoft.com/en-us/library/kdzttdcb(VS.80).aspx The routine given to _beginthreadex as the start address should be either __stdcall or __clrcall.

> --- /dev/null
> +++ b/compat/vcbuild/libgit/libgit.vcproj
[...]
Show 11 quoted lines
> +		<Filter
> +			Name="compat"
> +			>
> +			<File
> +				RelativePath="..\..\..\compat\basename.c"
> +				>
> +			</File>
> +			<File
> +				RelativePath="..\..\..\compat\cygwin.h"
> +				>
> +			</File>
I am not sure what cygwin.h is doing here.
Show 10 quoted lines
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 9f941e4..3b683e6 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -87,7 +87,7 @@
>  #include <assert.h>
>  #include <regex.h>
>  #include <utime.h>
> -#ifndef __MINGW32__
> +#if !defined(__MINGW32__) && !defined(_MSC_VER)
IMHO, it should be:
#ifndef _WIN32

because it has nothing to do with a particular compiler but with the target platform. (Note: Cygwin GCC does not have _WIN32 defined, but MinGW GCC does, so it should not break anything.)

Dmitry

← back to recent threads