Skip to content

Commit 821cdad

Browse files
committed
WIP: Fix compilation with Visual Studio 2013
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 65d2fa8 commit 821cdad

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

compat/hstrerror.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <string.h>
22
#include <stdio.h>
3-
#include <netdb.h>
3+
//#include <netdb.h>
44

55
const char *githstrerror(int err)
66
{
77
static char buffer[48];
8-
switch (err)
8+
/* switch (err)
99
{
1010
case HOST_NOT_FOUND:
1111
return "Authoritative answer: host not found";
@@ -15,7 +15,7 @@ const char *githstrerror(int err)
1515
return "Non recoverable errors, FORMERR, REFUSED, NOTIMP";
1616
case TRY_AGAIN:
1717
return "Non-authoritative \"host not found\", or SERVERFAIL";
18-
}
18+
}*/
1919
sprintf(buffer, "Name resolution error %d", err);
2020
return buffer;
2121
}

compat/msvc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
#include <malloc.h>
77
#include <io.h>
88

9+
#pragma warning(disable: 4018)
10+
#pragma warning(disable: 4244)
11+
#define _ANONYMOUS_UNION
12+
#define O_ACCMODE (O_WRONLY | O_RDWR)
13+
914
/* porting function */
1015
#define inline __inline
1116
#define __inline__ __inline

compat/vcbuild/include/unistd.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ typedef unsigned long long uintmax_t;
4545

4646
typedef int64_t off64_t;
4747

48+
#if 0
4849
#define INTMAX_MIN _I64_MIN
4950
#define INTMAX_MAX _I64_MAX
5051
#define UINTMAX_MAX _UI64_MAX
5152

5253
#define UINT32_MAX 0xffffffff /* 4294967295U */
54+
#endif
5355

5456
#define STDIN_FILENO 0
5557
#define STDOUT_FILENO 1
@@ -96,4 +98,7 @@ typedef int64_t off64_t;
9698
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
9799
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
98100

101+
typedef uint32_t _sigset_t;
102+
typedef uint32_t pid_t;
103+
99104
#endif

config.mak.uname

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ ifeq ($(uname_S),Windows)
371371
NATIVE_CRLF = YesPlease
372372
DEFAULT_HELP_FORMAT = html
373373
NO_D_INO_IN_DIRENT = YesPlease
374+
NO_HSTRERROR = YesPlease
374375

375376
CC = compat/vcbuild/scripts/clink.pl
376377
AR = compat/vcbuild/scripts/lib.pl

xdiff/xutils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ static unsigned long xdl_hash_record_with_whitespace(char const **data,
271271
#define HIGHBITS REPEAT_BYTE(0x80)
272272

273273
/* Return the high bit set in the first byte that is a zero */
274+
#define inline
274275
static inline unsigned long has_zero(unsigned long a)
275276
{
276277
return ((a - ONEBYTES) & ~a) & HIGHBITS;

0 commit comments

Comments
 (0)