From 675a5baa0f3a9f67474e4f19bc195a0939bbf443 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 28 Sep 2015 19:52:38 +0100 Subject: [PATCH] Include stdint.h (where available) for uintptr_t. Commit f2e61275f introduced the use of uintptr_t, without adding an include of which is where the C standard says that type should be defined. This didn't cause a build failure, because Visual Studio also defines it in which we do include. But a user points out that other Windows toolchains - e.g. MinGW - don't necessarily do the same. I can't add an unconditional include of , because the VS I use for the current official builds doesn't have that header at all. So I conditionalise it out for old VS; if it needs throwing out for any other toolchain, I'll add further conditions as reports come in. --- windows/winstuff.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/windows/winstuff.h b/windows/winstuff.h index 5147c08f..4f2b4e88 100644 --- a/windows/winstuff.h +++ b/windows/winstuff.h @@ -11,6 +11,18 @@ #include #include /* for FILENAME_MAX */ +/* We use uintptr_t for Win32/Win64 portability, so we should in + * principle include stdint.h, which defines it according to the C + * standard. But older versions of Visual Studio - including the one + * used for official PuTTY builds as of 2015-09-28 - don't provide + * stdint.h at all, but do (non-standardly) define uintptr_t in + * stddef.h. So here we try to make sure _some_ standard header is + * included which defines uintptr_t. */ +#include +#if !defined _MSC_VER || _MSC_VER >= 1600 +#include +#endif + #include "tree234.h" #include "winhelp.h"