Cygwin 64 implements LP64 model, meaning that `long` is 64-bit. Also,
clang emits warnings about __stdcall being ignored on targets other than
32-bit x86, so don't use it.
As part of this commit, convert Boost.WinAPI declarations to its local
calling convention macros equivalent to WINAPI and NTAPI and avoid
defining those macros when possible.
For MSVC-9 though the default is still Windows Vista as the Windows SDK used
with that compiler does not support Windows 7 definitions.
Also added a define for NTDDI version of the latest update to Windows 10. This
latest version is used by default when the user selects Windows 10 target.
The wProcessorArchitecture member of the SYSTEM_INFO struct was previously
inaccessible due to incorrect use of nameless unions/structs. This commit
fixes that to that the member should now be directly accessible as a
member of SYSTEM_INFO.
This commit also marks the nameless structs/unions with the __extension__
attribute to hopefully avoid gcc warnings about using this non-standard
feature.
MSVC-14.1 emits an error for the namespace alias because the same-named
symbol is visible from the point of the alias declaration. Instead, define
a new winapi namespace and import the boost::winapi namespace contents
into it.
Despite that the library now appears at the top level in the filesystem and
namespace, it is still not intended to be used by Boost users - the library
is purposed as an internal tool for Boost needs.
The old headers are still present and define the old namespace as an alias
to the new namespace. Thus backward compatibility is preserved. These headers
will be removed as soon as all dependent libraries are updated.
While at it, also made some nonessential cleanup in headers.
This change offers more control over the target Windows version. By
defining BOOST_USE_NTDDI_VERSION the user is able to specify the Windows
version down to the particular Service Pack. By default
BOOST_USE_NTDDI_VERSION will be deduced from either NTDDI_VERSION or
BOOST_USE_WINAPI_VERSION (which, in turn can be deduced from other
macros). In the latter case the macro will default to the latest known
Service Pack shipped for the given Windows version.
In addition to more control on the user's side this change also allows to
define APIs that first appeared in a Service Pack as opposed to RTM. This
allowed to fix compilation of RtlCaptureStackBackTrace.
Also updated the workaround for CryptReleaseContext since Windows SDK 10.0
no longer requires it.
CryptReleaseContext is declared differently in MS Windows SDK 6.0A and
later when targeting Windows versions older than XP. This is not the case
in MinGW and MinGW-w64 and MSVC shipped with their own Windows SDK.
Also added BOOST_WINAPI_DEFINE_VERSION_MACROS config macro which allows
Boost.WinAPI to define Windows SDK version macros even when it is not
configured to include windows.h. This can help to ensure that the user
targets the same Windows version as Boost.