From 23f77116cafe9a88819b60c7606453ae0db8f35d Mon Sep 17 00:00:00 2001 From: "tony@chromium.org" Date: Thu, 2 Jun 2011 18:37:51 +0000 Subject: [PATCH] More POSIX support for Chromium, consisting mostly of broadening ifdefs. This patch cuts across modules, as there's only a handful necessary for each, with the most in chrome/test/. ALSA is enabled on FreeBSD and Solaris, as libasound has been ported to those two platforms, and I moved resolv.h in host_resolver_proc.cc, because it depends on headers from sys_addrinfo.h on FreeBSD. Patch by ruben (chromium@hybridsource.org) Review URL: http://codereview.chromium.org/6976055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87641 0039d316-1c4b-4281-b951-d872f2087c98 --- base/debug/leak_annotations.h | 2 +- .../ui/tab_contents/tab_contents_wrapper.cc | 4 ++-- chrome/chrome_tests.gypi | 2 +- chrome/common/chrome_constants.cc | 16 ++++++++-------- .../automated_ui_tests/automated_ui_tests.cc | 2 +- .../test/automation/automation_proxy_uitest.cc | 4 ++-- chrome/test/chrome_process_util.cc | 8 ++++---- chrome/test/plugin/pdf_browsertest.cc | 2 +- chrome/test/reliability/page_load_test.cc | 2 +- chrome/test/startup/feature_startup_test.cc | 2 +- chrome/test/startup/startup_test.cc | 2 +- chrome/test/test_launcher_utils.cc | 2 +- chrome/test/ui/history_uitest.cc | 4 ++-- chrome/test/ui_test_utils.cc | 2 +- gpu/command_buffer/service/gles2_cmd_decoder.cc | 2 +- gpu/demos/demos.gyp | 4 ++-- gpu/demos/framework/main_exe.cc | 8 ++++---- .../gles2_conform_support.gyp | 4 ++-- gpu/gles2_conform_support/native/main.cc | 8 ++++---- ipc/sync_socket_unittest.cc | 4 ++-- media/base/media_switches.cc | 2 +- media/base/media_switches.h | 2 +- media/tools/shader_bench/shader_bench.cc | 4 ++-- net/base/host_resolver_impl.cc | 8 +++++--- net/base/host_resolver_proc.cc | 10 +++++----- remoting/host/host_plugin.cc | 8 ++++---- skia/ext/image_operations_unittest.cc | 2 +- skia/ext/vector_platform_device_skia.cc | 2 +- 28 files changed, 62 insertions(+), 60 deletions(-) diff --git a/base/debug/leak_annotations.h b/base/debug/leak_annotations.h index cb03320aebcc7b..1f8b28a2a68dae 100644 --- a/base/debug/leak_annotations.h +++ b/base/debug/leak_annotations.h @@ -8,7 +8,7 @@ #include "build/build_config.h" -#if defined(OS_LINUX) && defined(USE_HEAPCHECKER) +#if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(USE_HEAPCHECKER) #include "third_party/tcmalloc/chromium/src/google/heap-checker.h" diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc index b362ddab70c595..bfcad377f96cbd 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc @@ -151,7 +151,7 @@ TabContentsWrapper::TabContentsWrapper(TabContents* contents) NotificationService::AllSources()); registrar_.Add(this, NotificationType::USER_STYLE_SHEET_UPDATED, NotificationService::AllSources()); -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, NotificationService::AllSources()); #endif @@ -413,7 +413,7 @@ void TabContentsWrapper::Observe(NotificationType type, case NotificationType::USER_STYLE_SHEET_UPDATED: UpdateWebPreferences(); break; -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) case NotificationType::BROWSER_THEME_CHANGED: { UpdateRendererPreferences(); break; diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index dc1f16efd52ce8..bee903796efb6b 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -2973,7 +2973,7 @@ '../third_party/WebKit/Source/WebCore/WebCore.gyp/WebCore.gyp:webcore', ], }], - ['OS=="linux"', { + ['toolkit_uses_gtk == 1', { 'dependencies': [ '../build/linux/system.gyp:gtk', '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck', diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index e817be0a169fb5..d6d610edc10e33 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -27,27 +27,27 @@ const char kChromeVersionEnvVar[] = "CHROME_VERSION"; #if defined(OS_WIN) const FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome.exe"); const FilePath::CharType kHelperProcessExecutableName[] = FPL("chrome.exe"); -#elif defined(OS_LINUX) -const FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome"); -// Helper processes end up with a name of "exe" due to execing via -// /proc/self/exe. See bug 22703. -const FilePath::CharType kHelperProcessExecutableName[] = FPL("exe"); #elif defined(OS_MACOSX) const FilePath::CharType kBrowserProcessExecutableName[] = FPL(PRODUCT_STRING); const FilePath::CharType kHelperProcessExecutableName[] = FPL(PRODUCT_STRING " Helper"); +#elif defined(OS_POSIX) +const FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome"); +// Helper processes end up with a name of "exe" due to execing via +// /proc/self/exe. See bug 22703. +const FilePath::CharType kHelperProcessExecutableName[] = FPL("exe"); #endif // OS_* #if defined(OS_WIN) const FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome.exe"); const FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome.exe"); -#elif defined(OS_LINUX) -const FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome"); -const FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome"); #elif defined(OS_MACOSX) const FilePath::CharType kBrowserProcessExecutablePath[] = FPL(PRODUCT_STRING ".app/Contents/MacOS/" PRODUCT_STRING); const FilePath::CharType kHelperProcessExecutablePath[] = FPL(PRODUCT_STRING " Helper.app/Contents/MacOS/" PRODUCT_STRING " Helper"); +#elif defined(OS_POSIX) +const FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome"); +const FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome"); #endif // OS_* #if defined(OS_MACOSX) const FilePath::CharType kFrameworkName[] = diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index 1ac32765344fc9..22f8320df2ecb2 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -113,7 +113,7 @@ std::string GetChromeRevision() { file_info.reset( FileVersionInfo::CreateFileVersionInfo(FilePath(kChromeDll))); last_change = WideToASCII(file_info->last_change()); -#elif defined(OS_LINUX) || defined(OS_MACOSX) +#elif defined(OS_POSIX) chrome::VersionInfo version_info; last_change = version_info.LastChange(); #endif // !defined(OS_WIN) diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc index 280e60d547bbae..b43af3c155f58a 100644 --- a/chrome/test/automation/automation_proxy_uitest.cc +++ b/chrome/test/automation/automation_proxy_uitest.cc @@ -1382,7 +1382,7 @@ TEST_F(ExternalTabUITestPopupEnabled, MAYBE_UserGestureTargetBlank) { #endif // defined(OS_WIN) // TODO(port): Need to port autocomplete_edit_proxy.* first. -#if defined(OS_WIN) || defined(OS_LINUX) +#if !defined(OS_MACOSX) TEST_F(AutomationProxyTest, AutocompleteGetSetText) { scoped_refptr browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); @@ -1426,7 +1426,7 @@ TEST_F(AutomationProxyTest, AutocompleteParallelProxy) { EXPECT_EQ(text_to_set2, actual_text2); } -#endif // defined(OS_WIN) || defined(OS_LINUX) +#endif // !defined(OS_MACOSX) #if defined(OS_MACOSX) // Disabled, http://crbug.com/48601. diff --git a/chrome/test/chrome_process_util.cc b/chrome/test/chrome_process_util.cc index 52cb1205f44c2e..f17402665ab6a2 100644 --- a/chrome/test/chrome_process_util.cc +++ b/chrome/test/chrome_process_util.cc @@ -61,8 +61,8 @@ ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { result.push_back(process_entry->pid()); } -#if defined(OS_LINUX) - // On Linux we might be running with a zygote process for the renderers. +#if defined(OS_POSIX) && !defined(OS_MACOSX) + // On Unix we might be running with a zygote process for the renderers. // Because of that we sweep the list of processes again and pick those which // are children of one of the processes that we've already seen. { @@ -72,9 +72,9 @@ ChromeProcessList GetRunningChromeProcesses(base::ProcessId browser_pid) { while (const base::ProcessEntry* process_entry = it.NextProcessEntry()) result.push_back(process_entry->pid()); } -#endif // defined(OS_LINUX) +#endif // defined(OS_POSIX) && !defined(OS_MACOSX) -#if defined(OS_LINUX) || defined(OS_MACOSX) +#if defined(OS_POSIX) // On Mac OS X we run the subprocesses with a different bundle, and // on Linux via /proc/self/exe, so they end up with a different // name. We must collect them in a second pass. diff --git a/chrome/test/plugin/pdf_browsertest.cc b/chrome/test/plugin/pdf_browsertest.cc index 53dd9af7189d36..0894841a128acc 100644 --- a/chrome/test/plugin/pdf_browsertest.cc +++ b/chrome/test/plugin/pdf_browsertest.cc @@ -291,7 +291,7 @@ IN_PROC_BROWSER_TEST_F(PDFBrowserTest, FLAKY_SLOW_Loading) { std::string filename = file_path.BaseName().MaybeAsASCII(); ASSERT_FALSE(filename.empty()); -#if defined(OS_MACOSX) || defined(OS_LINUX) +#if defined(OS_POSIX) if (filename == "sample.pdf") continue; // Crashes on Mac and Linux. http://crbug.com/63549 #endif diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index e4c116126e0208..a1ea4862e6fb6c 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -193,7 +193,7 @@ class PageLoadTest : public UITest { file_info.reset( FileVersionInfo::CreateFileVersionInfo(FilePath(kChromeDll))); last_change = WideToASCII(file_info->last_change()); -#elif defined(OS_LINUX) || defined(OS_MACOSX) +#elif defined(OS_POSIX) // TODO(fmeawad): On Mac, the version retrieved here belongs to the test // module and not the chrome binary, need to be changed to chrome binary // instead. diff --git a/chrome/test/startup/feature_startup_test.cc b/chrome/test/startup/feature_startup_test.cc index 2ea89799582088..dcfffcebb25576 100644 --- a/chrome/test/startup/feature_startup_test.cc +++ b/chrome/test/startup/feature_startup_test.cc @@ -198,7 +198,7 @@ TEST_F(NewTabUIStartupTest, FLAKY_NewTabTimingTestsCold) { RunNewTabTimingTest(); } -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) TEST_F(NewTabUIStartupTest, GtkThemeCold) { RunStartupTest("tab_gtk_theme_cold", false /* cold */, false /* not important */, diff --git a/chrome/test/startup/startup_test.cc b/chrome/test/startup/startup_test.cc index b65583c3402a61..1b8a534d7e0f1f 100644 --- a/chrome/test/startup/startup_test.cc +++ b/chrome/test/startup/startup_test.cc @@ -366,7 +366,7 @@ TEST_F(StartupTest, PerfComplexTheme) { ProxyLauncher::COMPLEX_THEME, 0, 0); } -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) TEST_F(StartupTest, PerfGtkTheme) { RunStartupTest("warm", "gtk-theme", WARM, NOT_IMPORTANT, ProxyLauncher::NATIVE_THEME, 0, 0); diff --git a/chrome/test/test_launcher_utils.cc b/chrome/test/test_launcher_utils.cc index d4b16d04211032..759267f591959c 100644 --- a/chrome/test/test_launcher_utils.cc +++ b/chrome/test/test_launcher_utils.cc @@ -67,7 +67,7 @@ bool OverrideUserDataDir(const FilePath& user_data_dir) { // This matches what is done in ChromeMain(). success = PathService::Override(chrome::DIR_USER_DATA, user_data_dir); -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) // Make sure the cache directory is inside our clear profile. Otherwise // the cache may contain data from earlier tests that could break the // current test. diff --git a/chrome/test/ui/history_uitest.cc b/chrome/test/ui/history_uitest.cc index a7f0e14c868bf7..832552141a359c 100644 --- a/chrome/test/ui/history_uitest.cc +++ b/chrome/test/ui/history_uitest.cc @@ -84,7 +84,7 @@ TEST_F(HistoryTester, VerifyHistoryLength3) { kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms()); } -#if defined(OS_WIN) || defined(OS_LINUX) +#if !defined(OS_MACOSX) TEST_F(HistoryTester, ConsiderRedirectAfterGestureAsUserInitiated) { // Test the history length for the following page transition. // @@ -116,7 +116,7 @@ TEST_F(HistoryTester, ConsiderRedirectAfterGestureAsUserInitiated) { WaitForFinish("History_Length_Test_12", "1", url, kTestCompleteCookie, kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms()); } -#endif // defined(OS_WIN) || defined(OS_LINUX) +#endif // !defined(OS_MACOSX) TEST_F(HistoryTester, ConsiderSlowRedirectAsUserInitiated) { // Test the history length for the following page transition. diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index dd5f58190a0bfe..a0f2fb1325b1d2 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -289,7 +289,7 @@ void RunMessageLoop() { #if defined(TOOLKIT_VIEWS) views::AcceleratorHandler handler; loop->Run(&handler); -#elif defined(OS_LINUX) +#elif defined(OS_POSIX) && !defined(OS_MACOSX) loop->Run(NULL); #else loop->Run(); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index dec7c34f794084..5f295457948709 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -2629,7 +2629,7 @@ void GLES2DecoderImpl::DoCopyTextureToParentTextureCHROMIUM( } void GLES2DecoderImpl::DoResizeCHROMIUM(GLuint width, GLuint height) { -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) // Make sure that we are done drawing to the back buffer before resizing. glFinish(); #endif diff --git a/gpu/demos/demos.gyp b/gpu/demos/demos.gyp index 4da7107e35b499..d9e60fcd925ff9 100644 --- a/gpu/demos/demos.gyp +++ b/gpu/demos/demos.gyp @@ -14,7 +14,7 @@ # also be compiled with -fPIC flag. Setting GYP_DEFINES="linux_fpic=1" # compiles everything with -fPIC. Disable pepper demos on linux/x64 # unless linux_fpic is 1. - ['OS=="linux" and (target_arch=="x64" or target_arch=="arm") and linux_fpic!=1', { + ['os_posix == 1 and OS != "mac" and (target_arch=="x64" or target_arch=="arm") and linux_fpic!=1', { 'enable_pepper_demos%': 0, }, { 'enable_pepper_demos%': 1, @@ -107,7 +107,7 @@ ], }, 'conditions': [ - ['OS=="linux"', { + ['os_posix == 1 and OS != "mac"', { # -gstabs, used in the official builds, causes an ICE. Remove it. 'cflags!': ['-gstabs'], }], diff --git a/gpu/demos/framework/main_exe.cc b/gpu/demos/framework/main_exe.cc index 0c548044ea1526..296d164e1015db 100644 --- a/gpu/demos/framework/main_exe.cc +++ b/gpu/demos/framework/main_exe.cc @@ -8,9 +8,9 @@ #include "gpu/demos/framework/window.h" #include "ui/gfx/gl/gl_surface.h" -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) #include -#endif // OS_LINUX +#endif // TOOLKIT_USES_GTK namespace { static const int kWindowWidth = 512; @@ -18,9 +18,9 @@ static const int kWindowHeight = 512; } // namespace. int main(int argc, char** argv) { -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) gtk_init(&argc, &argv); -#endif // OS_LINUX +#endif // TOOLKIT_USES_GTK // AtExitManager is used by singleton classes to delete themselves when // the program terminates. diff --git a/gpu/gles2_conform_support/gles2_conform_support.gyp b/gpu/gles2_conform_support/gles2_conform_support.gyp index 45737d43467bb9..d0ed80ad4d8938 100644 --- a/gpu/gles2_conform_support/gles2_conform_support.gyp +++ b/gpu/gles2_conform_support/gles2_conform_support.gyp @@ -54,7 +54,7 @@ 'egl_native', ], 'conditions': [ - ['OS=="linux"', { + ['toolkit_uses_gtk == 1', { 'dependencies': ['../../build/linux/system.gyp:gtk'], }], ], @@ -76,7 +76,7 @@ '<(DEPTH)/third_party/expat/expat.gyp:expat', ], 'conditions': [ - ['OS=="linux"', { + ['toolkit_uses_gtk == 1', { 'dependencies': ['../../build/linux/system.gyp:gtk'], }], ], diff --git a/gpu/gles2_conform_support/native/main.cc b/gpu/gles2_conform_support/native/main.cc index 032318cf53c5b6..fd3dc7554f2a4c 100644 --- a/gpu/gles2_conform_support/native/main.cc +++ b/gpu/gles2_conform_support/native/main.cc @@ -5,9 +5,9 @@ #include "base/at_exit.h" #include "base/message_loop.h" -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) #include -#endif // OS_LINUX +#endif extern "C" { #if defined(GLES2_CONFORM_SUPPORT_ONLY) @@ -18,9 +18,9 @@ extern "C" { } int main(int argc, char *argv[]) { -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) gtk_init(&argc, &argv); -#endif // OS_LINUX +#endif base::AtExitManager at_exit; MessageLoopForUI message_loop; diff --git a/ipc/sync_socket_unittest.cc b/ipc/sync_socket_unittest.cc index 4b2dd131a92048..1a4ae13d89cda2 100644 --- a/ipc/sync_socket_unittest.cc +++ b/ipc/sync_socket_unittest.cc @@ -20,9 +20,9 @@ #include "testing/gtest/include/gtest/gtest.h" #include "testing/multiprocess_func_list.h" -#if defined(OS_LINUX) || defined(OS_MACOSX) +#if defined(OS_POSIX) #include "base/file_descriptor_posix.h" -#endif // defined(OS_LINUX) || defined(OS_MACOSX) +#endif enum IPCMessageIds { UNUSED_IPC_TYPE, diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index 92c70199cf5884..c93727ef56e625 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc @@ -6,7 +6,7 @@ namespace switches { -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_SOLARIS) // The Alsa device to use when opening an audio stream. const char kAlsaOutputDevice[] = "alsa-output-device"; // The Alsa device to use when opening an audio input stream. diff --git a/media/base/media_switches.h b/media/base/media_switches.h index 5fb98f252c7bcf..904f9bc16a930d 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h @@ -11,7 +11,7 @@ namespace switches { -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_SOLARIS) extern const char kAlsaOutputDevice[]; extern const char kAlsaInputDevice[]; #endif diff --git a/media/tools/shader_bench/shader_bench.cc b/media/tools/shader_bench/shader_bench.cc index 17210a60db6b95..948b3738372eb4 100644 --- a/media/tools/shader_bench/shader_bench.cc +++ b/media/tools/shader_bench/shader_bench.cc @@ -25,7 +25,7 @@ #include "ui/gfx/gl/gl_surface.h" #include "ui/gfx/native_widget_types.h" -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) #include #endif @@ -98,7 +98,7 @@ int main(int argc, char** argv) { } // Read command line. -#if defined(OS_LINUX) +#if defined(TOOLKIT_USES_GTK) gtk_init(&argc, &argv); #endif CommandLine::Init(argc, argv); diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc index 9a02f104a20751..8441f2a2291172 100644 --- a/net/base/host_resolver_impl.cc +++ b/net/base/host_resolver_impl.cc @@ -99,13 +99,15 @@ HostCache* CreateDefaultCache() { std::vector GetAllGetAddrinfoOSErrors() { int os_errors[] = { #if defined(OS_POSIX) +#if !defined(OS_FREEBSD) EAI_ADDRFAMILY, + EAI_NODATA, +#endif EAI_AGAIN, EAI_BADFLAGS, EAI_FAIL, EAI_FAMILY, EAI_MEMORY, - EAI_NODATA, EAI_NONAME, EAI_SERVICE, EAI_SOCKTYPE, @@ -1058,7 +1060,7 @@ HostResolverImpl::HostResolverImpl( #if defined(OS_WIN) EnsureWinsockInit(); #endif -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) if (HaveOnlyLoopbackAddresses()) additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; #endif @@ -1598,7 +1600,7 @@ void HostResolverImpl::OnIPAddressChanged() { ipv6_probe_job_ = new IPv6ProbeJob(this); ipv6_probe_job_->Start(); } -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) if (HaveOnlyLoopbackAddresses()) { additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; } else { diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc index 30f453fee7a8d8..10523a34942c83 100644 --- a/net/base/host_resolver_proc.cc +++ b/net/base/host_resolver_proc.cc @@ -6,16 +6,16 @@ #include "build/build_config.h" -#if defined(OS_POSIX) && !defined(OS_MACOSX) -#include -#endif - #include "base/logging.h" #include "net/base/address_list.h" #include "net/base/dns_reload_timer.h" #include "net/base/net_errors.h" #include "net/base/sys_addrinfo.h" +#if defined(OS_POSIX) && !defined(OS_MACOSX) +#include +#endif + namespace net { namespace { @@ -248,7 +248,7 @@ int SystemHostResolverProc(const std::string& host, #if defined(OS_WIN) if (err != WSAHOST_NOT_FOUND && err != WSANO_DATA) return ERR_NAME_RESOLUTION_FAILED; -#elif defined(OS_POSIX) +#elif defined(OS_POSIX) && !defined(OS_FREEBSD) if (err != EAI_NONAME && err != EAI_NODATA) return ERR_NAME_RESOLUTION_FAILED; #endif diff --git a/remoting/host/host_plugin.cc b/remoting/host/host_plugin.cc index 97422c6b7ec6eb..93418a60492c5c 100644 --- a/remoting/host/host_plugin.cc +++ b/remoting/host/host_plugin.cc @@ -919,9 +919,9 @@ OSCALL NPError NP_GetEntryPoints(NPPluginFuncs* nppfuncs) { } OSCALL NPError NP_Initialize(NPNetscapeFuncs* npnetscape_funcs -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) , NPPluginFuncs* nppfuncs -#endif // OS_LINUX +#endif ) { LOG(INFO) << "NP_Initialize"; if (g_at_exit_manager) @@ -935,9 +935,9 @@ OSCALL NPError NP_Initialize(NPNetscapeFuncs* npnetscape_funcs g_at_exit_manager = new base::AtExitManager; g_npnetscape_funcs = npnetscape_funcs; -#if defined(OS_LINUX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) NP_GetEntryPoints(nppfuncs); -#endif // OS_LINUX +#endif return NPERR_NO_ERROR; } diff --git a/skia/ext/image_operations_unittest.cc b/skia/ext/image_operations_unittest.cc index e8c0e9f3a8887a..ecb6e23c110d4e 100644 --- a/skia/ext/image_operations_unittest.cc +++ b/skia/ext/image_operations_unittest.cc @@ -506,7 +506,7 @@ TEST(ImageOperations, ResizeShouldAverageColors) { { skia::ImageOperations::RESIZE_HAMMING1, "HAMMING1", 0.0f }, { skia::ImageOperations::RESIZE_LANCZOS2, "LANCZOS2", 0.0f }, { skia::ImageOperations::RESIZE_LANCZOS3, "LANCZOS3", 0.0f }, -#if defined(OS_LINUX) && !defined(GTV) +#if defined(OS_POSIX) && !defined(GTV) // SUBPIXEL has slightly worse performance than the other filters: // 6.324 Bottom left/right corners // 5.099 Top left/right corners diff --git a/skia/ext/vector_platform_device_skia.cc b/skia/ext/vector_platform_device_skia.cc index 499d9aef8d4116..45a6fba1e7a4b7 100644 --- a/skia/ext/vector_platform_device_skia.cc +++ b/skia/ext/vector_platform_device_skia.cc @@ -56,7 +56,7 @@ PlatformDevice::PlatformSurface VectorPlatformDeviceSkia::BeginPlatformPaint() { pdf_device_->height(), false, /* not opaque */ NULL); -#elif defined(OS_LINUX) +#elif defined(OS_POSIX) raster_surface_ = BitmapPlatformDevice::Create(pdf_device_->width(), pdf_device_->height(), false /* not opaque */);