# [PATCH v2] msvc: Fix compilation error due to missing mktemp() declaration

3 messages from 2011-01-01 to 2011-01-11. Participants: Ramsay Jones, Junio C Hamano.
Thread: https://gitlist.dev/t/26171

## Ramsay Jones, 2011-01-01 20:31

Subject: [PATCH v2] msvc: Fix compilation error due to missing mktemp() declaration
Message-ID: <4D1F8F06.9090700@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/4D1F8F06.9090700%40ramsay1.demon.co.uk

```

Commit d1b6e6e (win32: use our own dirent.h, 2010-11-23) removed
the compat/vcbuild/include/dirent.h compatibility header file.
This file, among other things, included the <io.h> system header
file which provides the declaration of the mktemp() function.

In order to fix the compilation error, we add an include directive
for <io.h> to the compat/mingw.h header.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

Change from v1:
    - add #include to compat/mingw.h rather than compat/vcbuild/include/unistd.h

ATB,
Ramsay Jones

 compat/mingw.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/compat/mingw.h b/compat/mingw.h
index cafc1eb..1c6bc02 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -1,5 +1,6 @@
 #include <winsock2.h>
 #include <ws2tcpip.h>
+#include <io.h>
 
 /*
  * things that are not available in header files
-- 
1.7.3

```

## Ramsay Jones, 2011-01-11 18:33

Subject: Re: [PATCH v2] msvc: Fix compilation error due to missing mktemp() declaration
Message-ID: <4D2CA28A.4070401@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/4D2CA28A.4070401%40ramsay1.demon.co.uk
In-Reply-To: <4D1F8F06.9090700@ramsay1.demon.co.uk>

```
Ramsay Jones wrote:
> Commit d1b6e6e (win32: use our own dirent.h, 2010-11-23) removed
> the compat/vcbuild/include/dirent.h compatibility header file.
> This file, among other things, included the <io.h> system header
> file which provides the declaration of the mktemp() function.
> 
> In order to fix the compilation error, we add an include directive
> for <io.h> to the compat/mingw.h header.
> 
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
> ---
> 
> Change from v1:
>     - add #include to compat/mingw.h rather than compat/vcbuild/include/unistd.h
> 
> ATB,
> Ramsay Jones
> 
>  compat/mingw.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/compat/mingw.h b/compat/mingw.h
> index cafc1eb..1c6bc02 100644
> --- a/compat/mingw.h
> +++ b/compat/mingw.h
> @@ -1,5 +1,6 @@
>  #include <winsock2.h>
>  #include <ws2tcpip.h>
> +#include <io.h>
>  
>  /*
>   * things that are not available in header files

ping... Are there any remaining concerns regarding this patch?
Just let me know.

ATB,
Ramsay Jones

```

## Junio C Hamano, 2011-01-11 20:14

Subject: Re: [PATCH v2] msvc: Fix compilation error due to missing mktemp() declaration
Message-ID: <7vaaj742pw.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vaaj742pw.fsf%40alter.siamese.dyndns.org
In-Reply-To: <4D2CA28A.4070401@ramsay1.demon.co.uk>

```
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:

> ping... Are there any remaining concerns regarding this patch?

I dunno.  Is everybody on the Windows side happy with it?

```
