fix include order of windows.h

Comments that indicate a special include order is necessary because
GetCurrentDirectory might get redefined are outdated.  Remove those
outdated comments and use the normal ordering of includes.
This commit is contained in:
Daniel Pfeifer 2017-03-06 17:52:56 +01:00
parent 4d3f120c5f
commit 4b49c9a245
7 changed files with 17 additions and 21 deletions

View File

@ -279,7 +279,6 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#undef GetCurrentDirectory
void cmExportCommand::ReportRegistryError(std::string const& msg,
std::string const& key, long err)
{

View File

@ -1173,7 +1173,6 @@ void cmFindPackageCommand::FillPrefixesSystemRegistry()
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#undef GetCurrentDirectory
// http://msdn.microsoft.com/en-us/library/aa384253%28v=vs.85%29.aspx
#if !defined(KEY_WOW64_32KEY)
#define KEY_WOW64_32KEY 0x0200

View File

@ -1,12 +1,5 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "windows.h" // this must be first to define GetCurrentDirectory
#if defined(_MSC_VER) && _MSC_VER >= 1800
#define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
#endif
#endif
#include "cmGlobalGenerator.h"
#include <algorithm>
@ -19,6 +12,10 @@
#include <stdlib.h>
#include <string.h>
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
#endif
#include "cmAlgorithms.h"
#include "cmCPackPropertiesGenerator.h"
#include "cmComputeTargetDepends.h"
@ -51,6 +48,10 @@
#include <cm_jsoncpp_writer.h>
#endif
#if defined(_MSC_VER) && _MSC_VER >= 1800
#define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
#endif
const std::string kCMAKE_PLATFORM_INFO_INITIALIZED =
"CMAKE_PLATFORM_INFO_INITIALIZED";

View File

@ -1,7 +1,5 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "windows.h" // this must be first to define GetCurrentDirectory
#include "cmGlobalVisualStudio7Generator.h"
#include "cmGeneratedFileStream.h"
@ -14,6 +12,7 @@
#include <cmsys/Encoding.hxx>
#include <assert.h>
#include <windows.h>
static cmVS7FlagTable cmVS7ExtraFlagTable[] = {
// Precompiled header and related options. Note that the

View File

@ -5,6 +5,7 @@
#include <cmsys/Encoding.hxx>
#include <iostream>
#include <windows.h>
#include "cmAlgorithms.h"
#include "cmCallVisualStudioMacro.h"
@ -441,8 +442,6 @@ std::string cmGlobalVisualStudioGenerator::GetStartupProjectName(
return this->GetAllTargetName();
}
#include <windows.h>
bool IsVisualStudioMacrosFileRegistered(const std::string& macrosFile,
const std::string& regKeyBase,
std::string& nextAvailableSubKeyName)

View File

@ -16,6 +16,7 @@
#include "cmGeneratedFileStream.h"
#include <ctype.h> // for isspace
#include <windows.h>
static bool cmLVS7G_IsFAT(const char* dir);
@ -2115,7 +2116,6 @@ std::string cmLocalVisualStudio7Generator::GetTargetDirectory(
return dir;
}
#include <windows.h>
static bool cmLVS7G_IsFAT(const char* dir)
{
if (dir[0] && dir[1] == ':') {

View File

@ -1,11 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
// include these first, otherwise there will be problems on Windows
// with GetCurrentDirectory() being redefined
#ifdef CMAKE_BUILD_WITH_CMAKE
#include "cmDocumentation.h"
#include "cmDynamicLoader.h"
#endif
#include <cmConfigure.h>
#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
@ -17,7 +12,11 @@
#include "cmake.h"
#include "cmcmd.h"
#include <cmConfigure.h>
#ifdef CMAKE_BUILD_WITH_CMAKE
#include "cmDocumentation.h"
#include "cmDynamicLoader.h"
#endif
#include <cmsys/Encoding.hxx>
#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
#include <cmsys/ConsoleBuf.hxx>