Bug 1146923: Merge |CONVERT| macros of Bluetooth backends, r=btian
☠☠ backed out by 8f132c4bba3d ☠ ☠
authorThomas Zimmermann <tdz@users.sourceforge.net>
Wed, 25 Mar 2015 10:38:00 +0100
changeset 265913 045020b31842f46212b3af70db377038e18cd39d
parent 265912 3328d912358cbb9c1d6490de08bb75f30e7a8814
child 265914 c5d4efed15e981c7f63ec5af27273eb3aa829eed
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbtian
bugs1146923
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1146923: Merge |CONVERT| macros of Bluetooth backends, r=btian
dom/bluetooth/BluetoothCommon.h
dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
dom/bluetooth/bluedroid/BluetoothHALHelpers.h
--- a/dom/bluetooth/BluetoothCommon.h
+++ b/dom/bluetooth/BluetoothCommon.h
@@ -7,16 +7,29 @@
 #ifndef mozilla_dom_bluetooth_bluetoothcommon_h__
 #define mozilla_dom_bluetooth_bluetoothcommon_h__
 
 #include "mozilla/Observer.h"
 #include "nsPrintfCString.h"
 #include "nsString.h"
 #include "nsTArray.h"
 
+#if MOZ_IS_GCC && MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
+/* use designated array initializers if supported */
+#define INIT_ARRAY_AT(in_, out_) \
+  [in_] = out_
+#else
+/* otherwise init array element by position */
+#define INIT_ARRAY_AT(in_, out_) \
+  out_
+#endif
+
+#define CONVERT(in_, out_) \
+  INIT_ARRAY_AT(in_, out_)
+
 extern bool gBluetoothDebugFlag;
 
 #define SWITCH_BT_DEBUG(V) (gBluetoothDebugFlag = V)
 
 #undef BT_LOG
 #if defined(MOZ_WIDGET_GONK)
 #include <android/log.h>
 
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
@@ -8,29 +8,16 @@
 #define mozilla_dom_bluetooth_bluedroid_bluetoothdaemonhelpers_h__
 
 #include "BluetoothCommon.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/dom/bluetooth/BluetoothTypes.h"
 #include "mozilla/ipc/BluetoothDaemonConnection.h"
 #include "nsThreadUtils.h"
 
-#if MOZ_IS_GCC && MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
-/* use designated array initializers if supported */
-#define INIT_ARRAY_AT(in_, out_) \
-  [in_] = out_
-#else
-/* otherwise init array element by position */
-#define INIT_ARRAY_AT(in_, out_) \
-  out_
-#endif
-
-#define CONVERT(in_, out_) \
-  INIT_ARRAY_AT(in_, out_)
-
 using namespace mozilla::ipc;
 
 BEGIN_BLUETOOTH_NAMESPACE
 
 //
 // Helper structures
 //
 
--- a/dom/bluetooth/bluedroid/BluetoothHALHelpers.h
+++ b/dom/bluetooth/bluedroid/BluetoothHALHelpers.h
@@ -14,26 +14,16 @@
 #if ANDROID_VERSION >= 18
 #include <hardware/bt_rc.h>
 #endif
 #include "BluetoothCommon.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/dom/bluetooth/BluetoothTypes.h"
 #include "nsThreadUtils.h"
 
-#if MOZ_IS_GCC && MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
-/* use designated array initializers if supported */
-#define CONVERT(in_, out_) \
-  [in_] = out_
-#else
-/* otherwise init array element by position */
-#define CONVERT(in_, out_) \
-  out_
-#endif
-
 BEGIN_BLUETOOTH_NAMESPACE
 
 //
 // Conversion
 //
 
 inline nsresult
 Convert(bt_status_t aIn, BluetoothStatus& aOut)