Skip to content

Commit 1a3b5a3

Browse files
Ramsay Jonesgitster
authored andcommitted
msvc: Fix build by adding missing INTMAX_MAX define
Commit c03c831 (do not depend on signed integer overflow, 05-10-2010) provokes an msvc build failure. The cause of the failure is a missing definition of the INTMAX_MAX constant, used in the new maximum_signed_value_of_type(a) macro, which would normally be defined in the C99 <stdint.h> header file. In order the fix the compilation error, we add an appropriate definition of the INTMAX_MAX constant, along with INTMAX_MIN and UINTMAX_MAX, to an msvc compat header file. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent b7037b6 commit 1a3b5a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compat/vcbuild/include/unistd.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ typedef unsigned long long uintmax_t;
4545

4646
typedef int64_t off64_t;
4747

48+
#define INTMAX_MIN _I64_MIN
49+
#define INTMAX_MAX _I64_MAX
50+
#define UINTMAX_MAX _UI64_MAX
51+
4852
#define STDOUT_FILENO 1
4953
#define STDERR_FILENO 2
5054

0 commit comments

Comments
 (0)