{"thread":{"id":"25954","subject":"[PATCH 03/14] msvc: Fix build by adding missing INTMAX_MAX define","startedAt":"2010-12-04T18:57:30Z","lastAt":"2010-12-09T19:19:48Z","messageCount":2,"participants":["Ramsay Jones","Erik Faye-Lund"],"isPatch":true,"patchVersion":1,"patchTotal":14},"messages":[{"id":"157311","messageId":"4CFA8F1A.3040402@ramsay1.demon.co.uk","threadId":"25954","inReplyTo":null,"subject":"[PATCH 03/14] msvc: Fix build by adding missing INTMAX_MAX define","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2010-12-04T18:57:30Z","receivedAt":"2010-12-04T18:57:30Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit c03c831 (do not depend on signed integer overflow,\n05-10-2010) provokes an msvc build failure. The cause of the\nfailure is a missing definition of the INTMAX_MAX constant,\nused in the new maximum_signed_value_of_type(a) macro, which\nwould normally be defined in the C99 <stdint.h> header file.\n\nIn order the fix the compilation error, we add an appropriate\ndefinition of the INTMAX_MAX constant, along with INTMAX_MIN\nand UINTMAX_MAX, to an msvc compat header file.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n compat/vcbuild/include/unistd.h |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\nindex 2a4f276..b14fcf9 100644\n--- a/compat/vcbuild/include/unistd.h\n+++ b/compat/vcbuild/include/unistd.h\n@@ -45,6 +45,10 @@ typedef unsigned long long uintmax_t;\n \n typedef int64_t off64_t;\n \n+#define INTMAX_MIN  _I64_MIN\n+#define INTMAX_MAX  _I64_MAX\n+#define UINTMAX_MAX _UI64_MAX\n+\n #define STDOUT_FILENO 1\n #define STDERR_FILENO 2\n \n-- \n1.7.3\n"},{"id":"157711","messageId":"AANLkTi=_9kT9taLF97cngJ81sBCN9RDkzpk8uN-NW6tG@mail.gmail.com","threadId":"25954","inReplyTo":"4CFA8F1A.3040402@ramsay1.demon.co.uk","subject":"Re: [PATCH 03/14] msvc: Fix build by adding missing INTMAX_MAX define","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2010-12-09T19:19:48Z","receivedAt":"2010-12-09T19:19:48Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sat, Dec 4, 2010 at 7:57 PM, Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:\n>\n> Commit c03c831 (do not depend on signed integer overflow,\n> 05-10-2010) provokes an msvc build failure. The cause of the\n> failure is a missing definition of the INTMAX_MAX constant,\n> used in the new maximum_signed_value_of_type(a) macro, which\n> would normally be defined in the C99 <stdint.h> header file.\n>\n> In order the fix the compilation error, we add an appropriate\n> definition of the INTMAX_MAX constant, along with INTMAX_MIN\n> and UINTMAX_MAX, to an msvc compat header file.\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> ---\n>  compat/vcbuild/include/unistd.h |    4 ++++\n>  1 files changed, 4 insertions(+), 0 deletions(-)\n>\n> diff --git a/compat/vcbuild/include/unistd.h b/compat/vcbuild/include/unistd.h\n> index 2a4f276..b14fcf9 100644\n> --- a/compat/vcbuild/include/unistd.h\n> +++ b/compat/vcbuild/include/unistd.h\n> @@ -45,6 +45,10 @@ typedef unsigned long long uintmax_t;\n>\n>  typedef int64_t off64_t;\n>\n> +#define INTMAX_MIN  _I64_MIN\n> +#define INTMAX_MAX  _I64_MAX\n> +#define UINTMAX_MAX _UI64_MAX\n> +\n>  #define STDOUT_FILENO 1\n>  #define STDERR_FILENO 2\n>\n\nLooks good. You only really need to define INTMAX_MAX, but INTMAX_MIN\nand UINTMAX_MAX are nice additions for future code. I guess you\n*could* have added UINTMAX_MIN for completeness, but I doubt anyone\nwill ever bother to use it, as it's always 0. So for what it's worth:\n\nAcked-by: Erik Faye-Lund <kusmabite@gmail.com>\n\nIn case someone is curious of the definitions; they are documented at\nhttp://msdn.microsoft.com/en-us/library/k15zsh48.aspx\n"}]}