diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-21 20:58:50 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-21 20:58:50 +0000 |
commit | 3e2648a5ff01bae71647d0a02f87c5a0bee86b69 (patch) | |
tree | d1935d289bcfe76e37427592e3ff6644e2a1fe7b | |
parent | a99fce0ea927c4040410566b7c6a31049a9d9811 (diff) | |
download | chromium_src-3e2648a5ff01bae71647d0a02f87c5a0bee86b69.zip chromium_src-3e2648a5ff01bae71647d0a02f87c5a0bee86b69.tar.gz chromium_src-3e2648a5ff01bae71647d0a02f87c5a0bee86b69.tar.bz2 |
WinDDK ATL and MSVC express 2008/2005 compatability
Gives 'out of the box' compatability with VC2008 express - i.e. no modifications needed to system headers or .gyp* files or related hacks. Just set the GYP_MSVS_VERSION to 200Xe (e for express, same as the linked blog on the issue and first google hit as well).
1) Changes to build\common.gypi to turn off to define COMPILER_MSVC_EXPRESS if a express is detected (through the GYP_MSVC_VERSION environment variable), turn off the _SECURE_ATL define (which is flagged as an error with WinDDK's ATL, _SECURE_ATL adds [more] CRT checks to other ATL versions) and hard to link to the atl stdthunk library with express editions. Also, explicitly link to the base WinSDK libraries in common.gypi and mini_installer.gypi for MSVC 2005 express.
2) Fixes a few .cc files that have the wrong include order with the ATL headers when using the Windows DDK ATL. The Windows DDK ATL brings in intsafe.h (WinSDK, not WinDDK) with atlwin.h and generates multiple INTXX_MIN/MAX def warnings which get
flagged as errors with the warnings as errors flag if not included before other libraries that have the same definitions like ICU.
3) Changes to .rc files to avoid pulling in afxres.h (an MFC header -
it's available in the WinDDK) and winres.h which VCExpress doesn't have (it's available in a WinSDK sample, but that kind of the purpose of it). The main Chromium .rc files are already structured this way, I just changed the rest and changed the output of grit to do the same.
4) Removes the memset obj file linking in mini_installer.gyp and simply implements memset for mini_installer.cc.
Only changes to the chromium branch now. There are some .rc files in the Python26, Native Client, and Angle in samples that could #3 changes. They are not required for Chromium, however.
------
VC2005SP1 can be downloaded at
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=7B0B0339-613A-46E6-AB4D-080D4D4A8C4E&displaylang=en
(or non-SP1 at http://download.microsoft.com/download/8/3/a/83aad8f9-38ba-4503-b3cd-ba28c360c27b/ENU/vcsetup.exe)
VC2008SP1 can be downloaded at
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=F3FBB04E-92C2-4701-B4BA-92E26E408569&displaylang=en
currently.
The base developer instructions work fine afterwards with a couple tweaks for express versions:
http://www.chromium.org/developers/how-tos/build-instructions-windows
Under "Additional (free) downloads" under step 2:
X) Only the first 3 Non-SP KB Patches are needed for express. Don't forget to forget GYP_MSVS_VERSION environment as appropriate - 2008e for Visual C++ 2008 Express, for example.
Under "Additional (free) downloads" after step 5
[These only apply to 2008 express, 2005 works fine out of the box]:
6A) Download the WinDDK for the atl headers and libs -
http://msdn.microsoft.com/en-us/windows/hardware/gg487463.aspx. It works fine, but you do not need to install the whole DDK. In the WDK directory just install headers.msi, libs_x86fre.msi, and libs_x64fre.msi; just grab the atl headers and atl*.lib libs; right click the installers and uninstall afterwards. Add the appropriate include and lib paths to your global settings.
6B) To build x64 targets (x64 Native Client) download:
http://www.cppblog.com/Files/xcpp/VCE64BIT_WIN7SDK.zip
Follow the readme instructions.
Further information behind that and x64 target building with express:
- http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/
- http://www.cppblog.com/xcpp/archive/2009/09/09/vc2008express_64bit_win7sdk.html
----------------
BUG=1433, 5026, 72885
TEST=Compiles in both Debug and Release mode in Visual C++ Express 2008/2005 and does not effect other build setups. In addition, the WinDDK ATL compiles with the secure_atl=0 in the GYP_DEFINES environment variable on non-express versions of MSVC.
Review URL: http://codereview.chromium.org/6676030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78921 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | build/common.gypi | 37 | ||||
-rw-r--r-- | chrome/app/cf_resources.rc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc | 8 | ||||
-rw-r--r-- | chrome/default_plugin/plugin_database_handler.cc | 6 | ||||
-rw-r--r-- | chrome/installer/gcapi/gcapi_test.rc | 8 | ||||
-rw-r--r-- | chrome/installer/mini_installer.gyp | 23 | ||||
-rw-r--r-- | chrome/installer/mini_installer/mini_installer.cc | 59 | ||||
-rw-r--r-- | chrome/installer/setup/setup.rc | 8 | ||||
-rw-r--r-- | chrome/installer/setup/setup_unittests.rc | 8 | ||||
-rw-r--r-- | chrome/installer/tools/validate_installation.rc | 8 | ||||
-rw-r--r-- | chrome/installer/util/installer_util_unittests.rc | 20 | ||||
-rw-r--r-- | chrome/test/data/resource.rc | 8 | ||||
-rw-r--r-- | chrome_frame/chrome_tab_version.rc | 2 | ||||
-rw-r--r-- | chrome_frame/resources/tlb_resource.rc | 2 | ||||
-rw-r--r-- | tools/grit/grit/format/rc.py | 5 | ||||
-rw-r--r-- | tools/grit/grit/tool/resize.py | 5 | ||||
-rw-r--r-- | views/controls/table/table_view_unittest.cc | 12 | ||||
-rw-r--r-- | webkit/plugins/npapi/test/npapi_test.rc | 8 |
19 files changed, 174 insertions, 60 deletions
@@ -96,3 +96,4 @@ Magnus Danielsson <fuzzac@gmail.com> Kushal Pisavadia <kushi.p@gmail.com> Maarten Lankhorst <m.b.lankhorst@gmail.com> Vipul Bhasin <vipul.bhasin@gmail.com> +Ryan Norton <rnorton10@gmail.com> diff --git a/build/common.gypi b/build/common.gypi index 39ee2a9..da67502 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -452,6 +452,13 @@ },{ 'msvs_large_module_debug_link_mode%': '2', # Yes }], + ['MSVS_VERSION=="2010e" or MSVS_VERSION=="2008e" or MSVS_VERSION=="2005e"', { + 'msvs_express%': 1, + 'secure_atl%': 0, + },{ + 'msvs_express%': 0, + 'secure_atl%': 1, + }], ], 'nacl_win64_defines': [ # This flag is used to minimize dependencies when building @@ -1446,7 +1453,6 @@ '_CRT_RAND_S', 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS', 'WIN32_LEAN_AND_MEAN', - '_SECURE_ATL', '_ATL_NO_OPENGL', '_HAS_TR1=0', ], @@ -1456,6 +1462,11 @@ '_HAS_EXCEPTIONS=0', ], }], + ['secure_atl', { + 'defines': [ + '_SECURE_ATL', + ], + }], ], 'msvs_system_include_dirs': [ '<(DEPTH)/third_party/platformsdk_win7/files/Include', @@ -1474,9 +1485,12 @@ 'WarnAsError': 'true', 'DebugInformationFormat': '3', 'conditions': [ - [ 'msvs_multi_core_compile', { + ['msvs_multi_core_compile', { 'AdditionalOptions': ['/MP'], }], + ['MSVS_VERSION=="2005e"', { + 'AdditionalOptions': ['/w44068'], # Unknown pragma to 4 (ATL) + }], ['component=="shared_library"', { 'ExceptionHandling': '1', # /EHsc }, { @@ -1502,6 +1516,25 @@ 'psapi.lib', 'dbghelp.lib', ], + 'conditions': [ + ['msvs_express', { + # Explicitly required when using the ATL with express + 'AdditionalDependencies': [ + 'atlthunk.lib', + ], + }], + ['MSVS_VERSION=="2005e"', { + # Non-express versions link automatically to these + 'AdditionalDependencies': [ + 'advapi32.lib', + 'comdlg32.lib', + 'ole32.lib', + 'shell32.lib', + 'user32.lib', + 'winspool.lib', + ], + }], + ], 'AdditionalLibraryDirectories': [ '<(DEPTH)/third_party/platformsdk_win7/files/Lib', '<(DEPTH)/third_party/directxsdk/files/Lib/x86', diff --git a/chrome/app/cf_resources.rc b/chrome/app/cf_resources.rc index e2eba57..f6e9d85 100644 --- a/chrome/app/cf_resources.rc +++ b/chrome/app/cf_resources.rc @@ -8,7 +8,11 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "winres.h" +#include "winresrc.h" +#ifdef IDC_STATIC +#undef IDC_STATIC +#endif +#define IDC_STATIC (-1) ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc index 613c6a2..43d29e0 100644 --- a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc +++ b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc @@ -4,6 +4,14 @@ #include "chrome/browser/ui/views/autocomplete/autocomplete_result_view.h" +// Intentional header placing, including ATL, to avoid errors +#include "build/build_config.h" // NOLINT + +#if defined(OS_WIN) +#include <atlbase.h> // NOLINT +#include <atlwin.h> // NOLINT +#endif + #include "base/i18n/bidi_line_iterator.h" #include "chrome/browser/ui/views/autocomplete/autocomplete_result_view_model.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" diff --git a/chrome/default_plugin/plugin_database_handler.cc b/chrome/default_plugin/plugin_database_handler.cc index e634ada..227bd66 100644 --- a/chrome/default_plugin/plugin_database_handler.cc +++ b/chrome/default_plugin/plugin_database_handler.cc @@ -4,6 +4,10 @@ #include "chrome/default_plugin/plugin_database_handler.h" +// The placing of the ATL headers is intentional to avoid errors +#include <atlbase.h> +#include <atlwin.h> + #include "libxml/parser.h" #include "libxml/xpath.h" @@ -118,7 +122,7 @@ int32 PluginDatabaseHandler::Write(NPStream* stream, int32 offset, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (plugin_downloads_file_ == INVALID_HANDLE_VALUE) { - unsigned long error = ::GetLastError(); + DWORD error = ::GetLastError(); if (error == ERROR_SHARING_VIOLATION) { // File may have been downloaded by another plugin instance on this // page. diff --git a/chrome/installer/gcapi/gcapi_test.rc b/chrome/installer/gcapi/gcapi_test.rc index 5fcfed0..ee97e88 100644 --- a/chrome/installer/gcapi/gcapi_test.rc +++ b/chrome/installer/gcapi/gcapi_test.rc @@ -7,7 +7,9 @@ //
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -34,7 +36,9 @@ END 2 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
diff --git a/chrome/installer/mini_installer.gyp b/chrome/installer/mini_installer.gyp index 84a2f70..a531e90 100644 --- a/chrome/installer/mini_installer.gyp +++ b/chrome/installer/mini_installer.gyp @@ -58,22 +58,15 @@ 'IgnoreAllDefaultLibraries': 'true', 'OptimizeForWindows98': '1', 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS + 'AdditionalDependencies': [ + 'shlwapi.lib', + 'setupapi.lib', + ], 'conditions': [ - ['MSVS_VERSION=="2010"', { - 'AdditionalDependencies': [ - # These two object files are included in Visual Studio 2008 - # but not 2010. - # TODO(bradnelson): - # http://code.google.com/p/chromium/issues/detail?id=72885 - '"$(VCInstallDir)..\\..\\Microsoft Visual Studio 9.0\\VC\\' - 'crt\\src\\intel\\mt_lib\\memset.obj"', - '"$(VCInstallDir)..\\..\\Microsoft Visual Studio 9.0\\VC\\' - 'crt\\src\\intel\\mt_lib\\P4_memset.obj"', - ], - },{ - 'AdditionalDependencies': [ - '"$(VCInstallDir)crt\\src\\intel\\mt_lib\\memset.obj"', - '"$(VCInstallDir)crt\\src\\intel\\mt_lib\\P4_memset.obj"', + ['MSVS_VERSION=="2005e"', { + 'AdditionalDependencies': [ # Must explicitly link in VC2005E + 'advapi32.lib', + 'shell32.lib', ], }], ], diff --git a/chrome/installer/mini_installer/mini_installer.cc b/chrome/installer/mini_installer/mini_installer.cc index d9ed606..e48fb4f 100644 --- a/chrome/installer/mini_installer/mini_installer.cc +++ b/chrome/installer/mini_installer/mini_installer.cc @@ -6,10 +6,10 @@ // installed or upgraded. It is designed to be extremely small (~5KB with no // extra resources linked) and it has two main jobs: // 1) unpack the resources (possibly decompressing some) -// 2) run the real installer (setup.exe) with appropiate flags. +// 2) run the real installer (setup.exe) with appropriate flags. // -// In order to be really small we don't link against the CRT and we define the -// following compiler/linker flags: +// In order to be really small the app doesn't link against the CRT and +// defines the following compiler/linker flags: // EnableIntrinsicFunctions="true" compiler: /Oi // BasicRuntimeChecks="0" // BufferSecurityCheck="false" compiler: /GS- @@ -17,15 +17,8 @@ // IgnoreAllDefaultLibraries="true" linker: /NODEFAULTLIB // OptimizeForWindows98="1" liker: /OPT:NOWIN98 // linker: /SAFESEH:NO -// Also some built-in code that the compiler relies on is not defined so we -// are forced to manually link against it. It comes in the form of two -// object files that exist in $(VCInstallDir)\crt\src which are memset.obj and -// P4_memset.obj. These two object files rely on the existence of a static -// variable named __sse2_available which indicates the presence of intel sse2 -// extensions. We define it to false which causes a slower but safe code for -// memcpy and memset intrinsics. - -// having the linker merge the sections is saving us ~500 bytes. + +// have the linker merge the sections, saving us ~500 bytes. #pragma comment(linker, "/MERGE:.rdata=.text") #include <windows.h> @@ -43,9 +36,6 @@ template <typename T, size_t N> char (&ArraySizeHelper(T (&array)[N]))[N]; #define arraysize(array) (sizeof(ArraySizeHelper(array))) -// Required linker symbol. See remarks above. -extern "C" unsigned int __sse2_available = 0; - namespace mini_installer { typedef StackString<MAX_PATH> PathString; @@ -822,3 +812,42 @@ int MainEntryPoint() { int result = mini_installer::WMain(::GetModuleHandle(NULL)); ::ExitProcess(result); } + +// VC Express editions don't come with the memset CRT obj file and linking to +// the obj files between versions becomes a bit problematic. Therefore, +// simply implement memset. +// +// This also avoids having to explicitly set the __sse2_available hack when +// linking with both the x64 and x86 obj files which is required when not +// linking with the std C lib in certain instances (including Chromium) with +// MSVC. __sse2_available determines whether to use SSE2 intructions with +// std C lib routines, and is set by MSVC's std C lib implementation normally. +extern "C" { +#pragma function(memset) +void* memset(void* dest, int c, size_t count) { + // Simplistic 32-bit memset C implementation which assumes properly aligned + // memory; performance hit on memory that isn't properly aligned, but still + // better overall then a 8-bit implementation. + size_t adjcount = count >> 2; + UINT32 fill = (c << 24 | c << 16 | c << 8 | c); + UINT32* dest32 = reinterpret_cast<UINT32*>(dest); + UINT8* dest8 = reinterpret_cast<UINT8*>(dest); + + // Take care of the ending 0-3 bytes (binary 11 = 3). The lack of breaks is + // deliberate; it falls through for each byte. Think of it a simplified for + // loop. + switch (count - (adjcount << 2)) { + case 3: + dest8[count - 3] = c; + case 2: + dest8[count - 2] = c; + case 1: + dest8[count - 1] = c; + } + + while (adjcount-- > 0) // Copy the rest, 4 bytes/32 bits at a time + *(dest32++) = fill; + + return dest; +} +} // extern "C" diff --git a/chrome/installer/setup/setup.rc b/chrome/installer/setup/setup.rc index dba2332..c6d4b95 100644 --- a/chrome/installer/setup/setup.rc +++ b/chrome/installer/setup/setup.rc @@ -7,7 +7,9 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +36,9 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" "\0" END diff --git a/chrome/installer/setup/setup_unittests.rc b/chrome/installer/setup/setup_unittests.rc index 201a12b..bf19fcb 100644 --- a/chrome/installer/setup/setup_unittests.rc +++ b/chrome/installer/setup/setup_unittests.rc @@ -7,7 +7,9 @@ //
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -32,7 +34,9 @@ END 2 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
diff --git a/chrome/installer/tools/validate_installation.rc b/chrome/installer/tools/validate_installation.rc index e6d2858..d8c7323 100644 --- a/chrome/installer/tools/validate_installation.rc +++ b/chrome/installer/tools/validate_installation.rc @@ -7,7 +7,9 @@ //
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -32,7 +34,9 @@ END 2 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
diff --git a/chrome/installer/util/installer_util_unittests.rc b/chrome/installer/util/installer_util_unittests.rc index b7fe36b..c9c5416 100644 --- a/chrome/installer/util/installer_util_unittests.rc +++ b/chrome/installer/util/installer_util_unittests.rc @@ -7,7 +7,9 @@ //
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -32,7 +34,9 @@ END 2 TEXTINCLUDE
BEGIN
- "#include ""afxres.h""\r\n"
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"\0"
END
@@ -49,12 +53,12 @@ END -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// -#include "installer_util_strings.rc" - +/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+#include "installer_util_strings.rc"
+
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/test/data/resource.rc b/chrome/test/data/resource.rc index bdf6492..59c24cc 100644 --- a/chrome/test/data/resource.rc +++ b/chrome/test/data/resource.rc @@ -7,7 +7,9 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +36,9 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" "\0" END diff --git a/chrome_frame/chrome_tab_version.rc b/chrome_frame/chrome_tab_version.rc index 366c17e..60556d3 100644 --- a/chrome_frame/chrome_tab_version.rc +++ b/chrome_frame/chrome_tab_version.rc @@ -1,6 +1,6 @@ #include "version.h" -#include "winres.h" +#include "winresrc.h" #ifdef APSTUDIO_INVOKED # error Do not open this in the GUI, it will be massacred on save. Do not do it. diff --git a/chrome_frame/resources/tlb_resource.rc b/chrome_frame/resources/tlb_resource.rc index 96464d4..1267413 100644 --- a/chrome_frame/resources/tlb_resource.rc +++ b/chrome_frame/resources/tlb_resource.rc @@ -16,7 +16,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "winres.h" +#include "winresrc.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS diff --git a/tools/grit/grit/format/rc.py b/tools/grit/grit/format/rc.py index 4437b5e..f963fc6 100644 --- a/tools/grit/grit/format/rc.py +++ b/tools/grit/grit/format/rc.py @@ -309,8 +309,11 @@ class TopLevel(interface.ItemFormatter): // This file is automatically generated by GRIT. Do not edit. #include "%s" -#include <winres.h> #include <winresrc.h> +#ifdef IDC_STATIC +#undef IDC_STATIC +#endif +#define IDC_STATIC (-1) %s diff --git a/tools/grit/grit/tool/resize.py b/tools/grit/grit/tool/resize.py index 93e3c1c..f76f978 100644 --- a/tools/grit/grit/tool/resize.py +++ b/tools/grit/grit/tool/resize.py @@ -75,8 +75,11 @@ RC_TEMPLATE = '''\ // be ignored by GRIT. #include "resource.h" -#include <winres.h> #include <winresrc.h> +#ifdef IDC_STATIC +#undef IDC_STATIC +#endif +#define IDC_STATIC (-1) LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL diff --git a/views/controls/table/table_view_unittest.cc b/views/controls/table/table_view_unittest.cc index aa7d29d..c075054 100644 --- a/views/controls/table/table_view_unittest.cc +++ b/views/controls/table/table_view_unittest.cc @@ -2,7 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <vector> +// Intentional header placing, including ATL, to avoid errors +#include "build/build_config.h" // NOLINT + +#if defined(OS_WIN) +#include <atlbase.h> // NOLINT +#include <atlwin.h> // NOLINT +#endif + +#include <vector> // NOLINT #include "base/compiler_specific.h" #include "base/message_loop.h" @@ -21,7 +29,7 @@ #endif using ui::TableModel; -using ui::TableModelObserver; // TODO(beng): remove these +using ui::TableModelObserver; // TODO(beng): remove these // Put the tests in the views namespace to make it easier to declare them as // friend classes. diff --git a/webkit/plugins/npapi/test/npapi_test.rc b/webkit/plugins/npapi/test/npapi_test.rc index 524dda4..d877b10 100644 --- a/webkit/plugins/npapi/test/npapi_test.rc +++ b/webkit/plugins/npapi/test/npapi_test.rc @@ -7,7 +7,9 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +36,9 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" "\0" END |