зеркало из https://github.com/mozilla/pjs.git
Bug 651861 - ipc/chromium compilation broken on mingw
r=jones.chris.g
This commit is contained in:
Родитель
cf149732d0
Коммит
e44361abef
|
@ -139,7 +139,6 @@ CPPSRCS += \
|
|||
base_paths_win.cc \
|
||||
cpu.cc \
|
||||
condition_variable_win.cc \
|
||||
debug_on_start.cc \
|
||||
debug_util_win.cc \
|
||||
event_recorder.cc \
|
||||
file_util_win.cc \
|
||||
|
@ -173,6 +172,13 @@ CPPSRCS += \
|
|||
|
||||
endif # } OS_WIN
|
||||
|
||||
ifdef _MSC_VER # {
|
||||
|
||||
CPPSRCS += \
|
||||
debug_on_start.cc
|
||||
|
||||
endif # }
|
||||
|
||||
ifdef OS_POSIX # {
|
||||
|
||||
CPPSRCS += \
|
||||
|
|
|
@ -82,7 +82,6 @@ DEFINES += \
|
|||
-D_SECURE_ATL \
|
||||
-DCHROMIUM_BUILD \
|
||||
-DU_STATIC_IMPLEMENTATION \
|
||||
-DCOMPILER_MSVC \
|
||||
-DOS_WIN=1 \
|
||||
-DWIN32 \
|
||||
-D_WIN32 \
|
||||
|
@ -90,6 +89,10 @@ DEFINES += \
|
|||
-DWIN32_LEAN_AND_MEAN \
|
||||
$(NULL)
|
||||
|
||||
ifdef _MSC_VER
|
||||
DEFINES += -DCOMPILER_MSVC
|
||||
endif
|
||||
|
||||
else # } {
|
||||
|
||||
OS_LINUX = 1
|
||||
|
|
|
@ -124,7 +124,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
|
|||
} // namespace base
|
||||
|
||||
// Include our platform specific implementation.
|
||||
#if defined(OS_WIN) && defined(COMPILER_MSVC) && defined(ARCH_CPU_X86_FAMILY)
|
||||
#if defined(OS_WIN) && defined(ARCH_CPU_X86_FAMILY)
|
||||
#include "base/atomicops_internals_x86_msvc.h"
|
||||
#elif defined(OS_MACOSX) && defined(ARCH_CPU_X86_FAMILY)
|
||||
#include "base/atomicops_internals_x86_macosx.h"
|
||||
|
|
|
@ -42,7 +42,7 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
|
|||
return Barrier_AtomicIncrement(ptr, increment);
|
||||
}
|
||||
|
||||
#if !(defined(_MSC_VER) && _MSC_VER >= 1400)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1400)
|
||||
#error "We require at least vs2005 for MemoryBarrier"
|
||||
#endif
|
||||
inline void MemoryBarrier() {
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
// This only works on Windows.
|
||||
#if defined(OS_WIN)
|
||||
// This only works on MSVC.
|
||||
#if defined(COMPILER_MSVC)
|
||||
|
||||
#ifndef DECLSPEC_SELECTANY
|
||||
#define DECLSPEC_SELECTANY __declspec(selectany)
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include "base/file_path.h"
|
||||
#include "base/logging.h"
|
||||
|
||||
|
@ -288,6 +290,16 @@ std::wstring FilePath::ToWStringHack() const {
|
|||
}
|
||||
#endif
|
||||
|
||||
void FilePath::OpenInputStream(std::ifstream& stream) const {
|
||||
stream.open(
|
||||
#ifndef __MINGW32__
|
||||
path_.c_str(),
|
||||
#else
|
||||
base::SysWideToNativeMB(path_).c_str(),
|
||||
#endif
|
||||
std::ios::in | std::ios::binary);
|
||||
}
|
||||
|
||||
FilePath FilePath::StripTrailingSeparators() const {
|
||||
FilePath new_path(path_);
|
||||
new_path.StripTrailingSeparatorsInternal();
|
||||
|
|
|
@ -211,6 +211,9 @@ class FilePath {
|
|||
// separator.
|
||||
FilePath StripTrailingSeparators() const;
|
||||
|
||||
// Calls open on given ifstream instance
|
||||
void OpenInputStream(std::ifstream &stream) const;
|
||||
|
||||
// Older Chromium code assumes that paths are always wstrings.
|
||||
// This function converts a wstring to a FilePath, and is useful to smooth
|
||||
// porting that old code to the FilePath API.
|
||||
|
|
|
@ -144,10 +144,10 @@ bool ContentsEqual(const FilePath& filename1, const FilePath& filename2) {
|
|||
// We open the file in binary format even if they are text files because
|
||||
// we are just comparing that bytes are exactly same in both files and not
|
||||
// doing anything smart with text formatting.
|
||||
std::ifstream file1(filename1.value().c_str(),
|
||||
std::ios::in | std::ios::binary);
|
||||
std::ifstream file2(filename2.value().c_str(),
|
||||
std::ios::in | std::ios::binary);
|
||||
std::ifstream file1, file2;
|
||||
|
||||
filename1.OpenInputStream(file1);
|
||||
filename2.OpenInputStream(file2);
|
||||
|
||||
// Even if both files aren't openable (and thus, in some sense, "equal"),
|
||||
// any unusable file yields a result of "false".
|
||||
|
|
|
@ -191,9 +191,9 @@ void MessageLoop::RunHandler() {
|
|||
#if defined(OS_WIN)
|
||||
if (exception_restoration_) {
|
||||
LPTOP_LEVEL_EXCEPTION_FILTER current_filter = GetTopSEHFilter();
|
||||
__try {
|
||||
MOZ_SEH_TRY {
|
||||
RunInternal();
|
||||
} __except(SEHFilter(current_filter)) {
|
||||
} MOZ_SEH_EXCEPT(SEHFilter(current_filter)) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -57,10 +57,10 @@ void PlatformThread::SetName(const char* name) {
|
|||
info.dwThreadID = CurrentId();
|
||||
info.dwFlags = 0;
|
||||
|
||||
__try {
|
||||
MOZ_SEH_TRY {
|
||||
RaiseException(kVCThreadNameException, 0, sizeof(info)/sizeof(DWORD),
|
||||
reinterpret_cast<DWORD_PTR*>(&info));
|
||||
} __except(EXCEPTION_CONTINUE_EXECUTION) {
|
||||
} MOZ_SEH_EXCEPT(EXCEPTION_CONTINUE_EXECUTION) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ PR_ImplodeTime(const PRExplodedTime *exploded)
|
|||
// Convert from Windows epoch to NSPR epoch, and 100-nanoseconds units
|
||||
// to microsecond units.
|
||||
PRTime result =
|
||||
static_cast<PRTime>((uli.QuadPart / 10) - 11644473600000000i64);
|
||||
static_cast<PRTime>((uli.QuadPart / 10) - GG_LONGLONG(11644473600000000));
|
||||
// Adjust for time zone and dst. Convert from seconds to microseconds.
|
||||
result -= (exploded->tm_params.tp_gmt_offset +
|
||||
exploded->tm_params.tp_dst_offset) * kSecondsToMicroseconds;
|
||||
|
|
|
@ -251,7 +251,7 @@ class NowSingleton : public base::SystemMonitor::PowerObserver {
|
|||
// we keep our last_seen_ stay correctly in sync.
|
||||
DWORD now = tick_function();
|
||||
if (now < last_seen_)
|
||||
rollover_ += TimeDelta::FromMilliseconds(0x100000000I64); // ~49.7 days.
|
||||
rollover_ += TimeDelta::FromMilliseconds(GG_LONGLONG(0x100000000)); // ~49.7 days.
|
||||
last_seen_ = now;
|
||||
return TimeDelta::FromMilliseconds(now) + rollover_;
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ bool Subclass(HWND window, WNDPROC subclass_proc) {
|
|||
reinterpret_cast<WNDPROC>(GetWindowLongPtr(window, GWLP_WNDPROC));
|
||||
if (original_handler != subclass_proc) {
|
||||
win_util::SetWindowProc(window, subclass_proc);
|
||||
SetProp(window, kHandlerKey, original_handler);
|
||||
SetProp(window, kHandlerKey, (void*)original_handler);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче