diff options
author | pvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-25 23:54:54 +0000 |
---|---|---|
committer | pvalchev@google.com <pvalchev@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-25 23:54:54 +0000 |
commit | 8d5788267bcd591842932fd8761813c7fac3d987 (patch) | |
tree | f585dbb8cc13a244e32cc76ee4a24e89d33bab57 | |
parent | 93f0c77c33ac138c30a019a6c67de53d23810db0 (diff) | |
download | chromium_src-8d5788267bcd591842932fd8761813c7fac3d987.zip chromium_src-8d5788267bcd591842932fd8761813c7fac3d987.tar.gz chromium_src-8d5788267bcd591842932fd8761813c7fac3d987.tar.bz2 |
OpenBSD/FreeBSD ifdefs and GYP changes for base/
Based on original work by Sprewell and Ben Laurie on FreeBSD port
Review URL: http://codereview.chromium.org/548129
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37063 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/allocator/allocator.gyp | 2 | ||||
-rw-r--r-- | base/base.gyp | 10 | ||||
-rw-r--r-- | base/base.gypi | 2 | ||||
-rw-r--r-- | base/debug_util_unittest.cc | 4 | ||||
-rw-r--r-- | base/file_util_posix.cc | 6 | ||||
-rw-r--r-- | base/process_util_posix.cc | 3 |
6 files changed, 16 insertions, 11 deletions
diff --git a/base/allocator/allocator.gyp b/base/allocator/allocator.gyp index d32e368c..fe1aae8 100644 --- a/base/allocator/allocator.gyp +++ b/base/allocator/allocator.gyp @@ -310,7 +310,7 @@ '<(tcmalloc_dir)/src/profiler.cc', ], }], - ['OS=="linux" or OS=="freebsd"', { + ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', { 'sources!': [ '<(tcmalloc_dir)/src/system-alloc.h', '<(tcmalloc_dir)/src/windows/port.cc', diff --git a/base/base.gyp b/base/base.gyp index d59ebc1..9a139d0 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -37,7 +37,7 @@ 'i18n/word_iterator.h', ], 'conditions': [ - ['OS == "linux" or OS == "freebsd"', { + ['OS == "linux" or OS == "freebsd" or OS == "openbsd"', { 'dependencies': [ '../build/linux/system.gyp:gtk', ], @@ -157,7 +157,7 @@ '../testing/gtest.gyp:gtest', ], 'conditions': [ - ['OS == "linux" or OS == "freebsd"', { + ['OS == "linux" or OS == "freebsd" or OS == "openbsd"', { 'sources!': [ 'file_version_info_unittest.cc', 'worker_pool_linux_unittest.cc', @@ -175,7 +175,7 @@ '../build/linux/system.gyp:nss', '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck', ], - }, { # OS != "linux" and OS != "freebsd" + }, { # OS != "linux" and OS != "freebsd" and OS != "openbsd" 'sources!': [ 'message_pump_glib_unittest.cc', ] @@ -238,7 +238,7 @@ ], }, 'conditions': [ - ['OS == "linux" or OS == "freebsd"', { + ['OS == "linux" or OS == "freebsd" or OS == "openbsd"', { 'dependencies': [ # Needed to handle the #include chain: # base/test/perf_test_suite.h @@ -267,7 +267,7 @@ }, ], }], - [ 'OS == "linux" or OS == "freebsd"', { + [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd"', { 'targets': [ { 'target_name': 'linux_versioninfo', diff --git a/base/base.gypi b/base/base.gypi index 47789de..78d5f5b 100644 --- a/base/base.gypi +++ b/base/base.gypi @@ -277,7 +277,7 @@ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks', ], 'conditions': [ - [ 'OS != "linux" and OS != "freebsd"', { + [ 'OS != "linux" and OS != "freebsd" and OS != "openbsd"', { 'sources/': [ ['exclude', '/xdg_mime/'], ['exclude', '/xdg_user_dirs/'], diff --git a/base/debug_util_unittest.cc b/base/debug_util_unittest.cc index 7bee4cc..1ab32e7 100644 --- a/base/debug_util_unittest.cc +++ b/base/debug_util_unittest.cc @@ -20,12 +20,12 @@ TEST(StackTrace, DISABLED_OutputToStream) { trace.OutputToStream(&os); std::string backtrace_message = os.str(); -#if defined(OS_LINUX) && NDEBUG +#if defined(OS_POSIX) && !defined(OS_MACOSX) && NDEBUG // Stack traces require an extra data table that bloats our binaries, // so they're turned off for release builds. We stop the test here, // at least letting us verify that the calls don't crash. return; -#endif // defined(OS_LINUX) && NDEBUG +#endif // defined(OS_POSIX) && !defined(OS_MACOSX) && NDEBUG size_t frames_found = 0; trace.Addresses(&frames_found); diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index 0436c73..d7df8a0 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -85,7 +85,8 @@ int CountFilesCreatedAfter(const FilePath& path, DIR* dir = opendir(path.value().c_str()); if (dir) { -#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_FREEBSD) +#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_FREEBSD) && \ + !defined(OS_OPENBSD) #error Port warning: depending on the definition of struct dirent, \ additional space for pathname may be needed #endif @@ -628,7 +629,8 @@ bool FileEnumerator::ReadDirectory(std::vector<DirectoryEntryInfo>* entries, if (!dir) return false; -#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_FREEBSD) +#if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_FREEBSD) && \ + !defined(OS_OPENBSD) #error Port warning: depending on the definition of struct dirent, \ additional space for pathname may be needed #endif diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc index d92a4fa..c6759f9 100644 --- a/base/process_util_posix.cc +++ b/base/process_util_posix.cc @@ -182,6 +182,9 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) { #elif defined(OS_FREEBSD) static const rlim_t kSystemDefaultMaxFds = 8192; static const char fd_dir[] = "/dev/fd"; +#elif defined(OS_OPENBSD) + static const rlim_t kSystemDefaultMaxFds = 256; + static const char fd_dir[] = "/dev/fd"; #endif std::set<int> saved_fds; |