Bug 942334 - Build hal in unified mode; r=cjones

--HG--
extra : rebase_source : b3fae3b4456bfa8ef9920038668b403cc7c8accf
This commit is contained in:
Ehsan Akhgari 2013-11-25 14:57:18 -05:00
Родитель 9aa62569a7
Коммит 322dd501b7
5 изменённых файлов: 45 добавлений и 27 удалений

Просмотреть файл

@ -7,6 +7,10 @@
#ifndef mozilla_HalImpl_h
#define mozilla_HalImpl_h
#ifdef MOZ_UNIFIED_BUILD
#error Cannot use HalImpl.h in unified builds.
#endif
#define MOZ_HAL_NAMESPACE hal_impl
#undef mozilla_Hal_h
#undef mozilla_HalInternal_h

Просмотреть файл

@ -254,7 +254,7 @@ ModifyWakeLock(const nsAString& aTopic,
processWasLocked != (processCount.numLocks > 0))) {
WakeLockInformation info;
GetWakeLockInfo(aTopic, &info);
hal::GetWakeLockInfo(aTopic, &info);
NotifyWakeLockChange(info);
}
}

Просмотреть файл

@ -294,6 +294,7 @@ static float onegs[3]; // X, Y and Z one-g calibration values
#define APP_ID ((CFStringRef)@"com.suitable.SeisMacLib")
// These #defines make the accelStartup code a LOT easier to read.
#undef LOG
#define LOG(message) \
if (logObject) { \
[logObject performSelector:logSelector withObject:message]; \

Просмотреть файл

@ -21,51 +21,61 @@ EXPORTS.mozilla += [
]
TEST_DIRS += ['tests']
SOURCES += [
'Hal.cpp',
UNIFIED_SOURCES += [
'HalWakeLock.cpp',
'sandbox/SandboxHal.cpp',
'WindowIdentifier.cpp',
]
# Hal.cpp cannot be built in unified mode because it relies on HalImpl.h.
SOURCES += [
'Hal.cpp',
]
if CONFIG['MOZ_GAMEPAD_BACKEND'] == 'stub':
SOURCES += [
UNIFIED_SOURCES += [
'fallback/FallbackGamepad.cpp'
]
elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'cocoa':
SOURCES += [
UNIFIED_SOURCES += [
'cocoa/CocoaGamepad.cpp'
]
elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'windows':
SOURCES += [
UNIFIED_SOURCES += [
'windows/WindowsGamepad.cpp'
]
elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'linux':
SOURCES += [
UNIFIED_SOURCES += [
'linux/LinuxGamepad.cpp'
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
SOURCES += [
'android/AndroidHal.cpp',
UNIFIED_SOURCES += [
'android/AndroidSensor.cpp',
'fallback/FallbackAlarm.cpp',
'fallback/FallbackPower.cpp',
'linux/LinuxMemory.cpp',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
# AndroidHal.cpp cannot be built in unified mode because it relies on HalImpl.h.
SOURCES += [
'android/AndroidHal.cpp',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
UNIFIED_SOURCES += [
'gonk/GonkDiskSpaceWatcher.cpp',
'gonk/GonkFMRadio.cpp',
'gonk/GonkHal.cpp',
'gonk/GonkSensor.cpp',
'gonk/GonkSwitch.cpp',
'gonk/UeventPoller.cpp',
'linux/LinuxMemory.cpp',
'linux/LinuxPower.cpp',
]
elif CONFIG['OS_TARGET'] == 'Linux':
# GonkHal.cpp cannot be built in unified mode because it relies on HalImpl.h.
SOURCES += [
'gonk/GonkHal.cpp',
]
elif CONFIG['OS_TARGET'] == 'Linux':
UNIFIED_SOURCES += [
'fallback/FallbackAlarm.cpp',
'fallback/FallbackScreenConfiguration.cpp',
'fallback/FallbackSensor.cpp',
@ -74,25 +84,28 @@ elif CONFIG['OS_TARGET'] == 'Linux':
'linux/LinuxPower.cpp',
]
if CONFIG['MOZ_ENABLE_DBUS']:
SOURCES += [
UNIFIED_SOURCES += [
'linux/UPowerClient.cpp',
]
else:
SOURCES += [
UNIFIED_SOURCES += [
'fallback/FallbackBattery.cpp',
]
elif CONFIG['OS_TARGET'] == 'WINNT':
SOURCES += [
UNIFIED_SOURCES += [
'fallback/FallbackAlarm.cpp',
'fallback/FallbackMemory.cpp',
'fallback/FallbackPower.cpp',
'fallback/FallbackScreenConfiguration.cpp',
'fallback/FallbackVibration.cpp',
'windows/WindowsBattery.cpp',
'windows/WindowsSensor.cpp',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
# WindowsBattery.cpp cannot be built in unified mode because it relies on HalImpl.h.
SOURCES += [
'windows/WindowsBattery.cpp',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
UNIFIED_SOURCES += [
'cocoa/CocoaBattery.cpp',
'fallback/FallbackAlarm.cpp',
'fallback/FallbackMemory.cpp',
@ -101,7 +114,7 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
'fallback/FallbackVibration.cpp',
]
elif CONFIG['OS_TARGET'] in ('OpenBSD', 'NetBSD', 'FreeBSD', 'DragonFly'):
SOURCES += [
UNIFIED_SOURCES += [
'fallback/FallbackAlarm.cpp',
'fallback/FallbackMemory.cpp',
'fallback/FallbackPower.cpp',
@ -110,15 +123,15 @@ elif CONFIG['OS_TARGET'] in ('OpenBSD', 'NetBSD', 'FreeBSD', 'DragonFly'):
'fallback/FallbackVibration.cpp',
]
if CONFIG['MOZ_ENABLE_DBUS']:
SOURCES += [
UNIFIED_SOURCES += [
'linux/UPowerClient.cpp',
]
else:
SOURCES += [
UNIFIED_SOURCES += [
'fallback/FallbackBattery.cpp',
]
else:
SOURCES += [
UNIFIED_SOURCES += [
'fallback/FallbackAlarm.cpp',
'fallback/FallbackBattery.cpp',
'fallback/FallbackMemory.cpp',
@ -130,7 +143,7 @@ else:
# Fallbacks for backends implemented on Gonk only.
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
SOURCES += [
UNIFIED_SOURCES += [
'fallback/FallbackDiskSpaceWatcher.cpp',
'fallback/FallbackFactoryReset.cpp',
'fallback/FallbackFMRadio.cpp',
@ -144,12 +157,12 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
# Fallbacks for backends implemented on Android only.
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
SOURCES += [
UNIFIED_SOURCES += [
'fallback/FallbackNetwork.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
SOURCES += [
UNIFIED_SOURCES += [
'cocoa/CocoaSensor.mm',
'cocoa/smslib.mm',
]

Просмотреть файл

@ -321,8 +321,8 @@ private:
};
WindowsGamepadService::WindowsGamepadService()
: mThreadExitEvent(CreateEvent(nullptr, FALSE, FALSE, nullptr)),
mThreadRescanEvent(CreateEvent(nullptr, FALSE, FALSE, nullptr)),
: mThreadExitEvent(CreateEventW(nullptr, FALSE, FALSE, nullptr)),
mThreadRescanEvent(CreateEventW(nullptr, FALSE, FALSE, nullptr)),
mThread(nullptr),
dinput(nullptr) {
mObserver = new Observer(*this);
@ -416,7 +416,7 @@ WindowsGamepadService::EnumCallback(LPCDIDEVICEINSTANCE lpddi,
dp.diph.dwHow = DIPH_DEVICE;
dp.dwData = 64; // arbitrary
// Create event so DInput can signal us when there's new data.
gamepad.event = CreateEvent(nullptr, FALSE, FALSE, nullptr);
gamepad.event = CreateEventW(nullptr, FALSE, FALSE, nullptr);
// Set data format, event notification, and acquire device
if (gamepad.device->SetDataFormat(&c_dfDIJoystick) == DI_OK &&
gamepad.device->SetProperty(DIPROP_BUFFERSIZE, &dp.diph) == DI_OK &&