1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-28 15:24:49 -05:00

Include stdint.h (where available) for uintptr_t.

Commit f2e61275f introduced the use of uintptr_t, without adding an
include of <stdint.h> 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 <stddef.h> 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 <stdint.h>, 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.
This commit is contained in:
Simon Tatham 2015-09-28 19:52:38 +01:00
parent acff0a6fa3
commit 675a5baa0f

View File

@ -11,6 +11,18 @@
#include <windows.h>
#include <stdio.h> /* 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 <stddef.h>
#if !defined _MSC_VER || _MSC_VER >= 1600
#include <stdint.h>
#endif
#include "tree234.h"
#include "winhelp.h"