Closed Bug 1054791 Opened 10 years ago Closed 10 years ago

[Flatfish][Build] Build failed in BluetoothInterface.cpp: 'bt_remote_version_t' does not name a type

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S3 (29aug)

People

(Reporter: _AtilA_, Assigned: _AtilA_)

References

Details

(Whiteboard: [TCP][Flatfish])

Attachments

(1 file, 1 obsolete file)

Build is failing for Flatfish with this error:

../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:426:15: error: 'bt_remote_version_t' does not name a type
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:426:36: error: ISO C++ forbids declaration of 'aIn' with no type [-fpermissive]
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp: In function 'nsresult mozilla::dom::bluetooth::Convert(int const&, mozilla::dom::bluetooth::BluetoothRemoteInfo&)':
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:428:24: error: request for member 'version' in 'aIn', which is of non-class type 'int const'
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:429:24: error: request for member 'sub_ver' in 'aIn', which is of non-class type 'int const'
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:430:28: error: request for member 'manufacturer' in 'aIn', which is of non-class type 'int const'
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp: In function 'nsresult mozilla::dom::bluetooth::Convert(const bt_property_t&, mozilla::dom::bluetooth::BluetoothProperty&)':
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:844:33: error: expected type-specifier before 'bt_remote_version_t'
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:844:33: error: expected '>' before 'bt_remote_version_t'
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:844:33: error: expected '(' before 'bt_remote_version_t'
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:844:33: error: 'bt_remote_version_t' was not declared in this scope
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:844:53: error: expected primary-expression before '>' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp: In member function 'void mozilla::dom::bluetooth::BluetoothInterface::Init(mozilla::dom::bluetooth::BluetoothNotificationHandler*, mozilla::dom::bluetooth::BluetoothResultHandler*)':
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3039:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3040:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3041:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3042:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3043:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3044:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3045:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3046:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3047:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3048:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3049:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:3050:5: error: expected primary-expression before '.' token
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp: At global scope:
../../../gecko/dom/bluetooth/bluedroid/BluetoothInterface.cpp:426:1: warning: 'nsresult mozilla::dom::bluetooth::Convert(int const&, mozilla::dom::bluetooth::BluetoothRemoteInfo&)' defined but not used [-Wunused-function]

So there are 2 problems here:
* bt_remote_version_t is not defined for Flatfish platform version: JellyBean 4.2.2 (refs/tags/android-4.2.2_r1).
* Our toolchain is based on gcc-4.6 which lacks support for designated initializers.

My patch fixed both issues: I just surrounded incompatible code by #if ANDROID_VERSION >= 18 (this code is compatible since API level 18) and changed the designated initializer by a most common standard initializer.

I couldn't launch a test to make sure it doesn't break anything outside Flatfish environment, Could someone do it for me?

Hope it helps!
Assignee: nobody → atilag
Blocks: flatfish
Whiteboard: [TCP][Flatfish]
Comment on attachment 8474277 [details] [diff] [review]
0001-Bug-1054791-Flatfish-Build-Build-failed-in-Bluetooth.patch

Review of attachment 8474277 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for your patch and sorry for the inconvenience. We had several problems with the differences between branches and repositories recently.

::: dom/bluetooth/bluedroid/BluetoothInterface.cpp
@@ +3051,5 @@
> +    BluetoothCallback::AclStateChanged,
> +    BluetoothCallback::ThreadEvt,
> +    BluetoothCallback::DutModeRecv,
> +#if ANDROID_VERSION >= 18
> +    BluetoothCallback::LeTestMode

Please also put this function's definition under ifdef protection.
Attachment #8474277 - Flags: review?(tzimmermann) → review+
Disabling via #if LeTestMode stuff required to modify some more files :)
Attachment #8474277 - Attachment is obsolete: true
Attachment #8474474 - Flags: review?(tzimmermann)
Comment on attachment 8474474 [details] [diff] [review]
0001-Bug-1054791-Flatfish-Build-Build-failed-in-Bluetooth.2.patch

Review of attachment 8474474 [details] [diff] [review]:
-----------------------------------------------------------------

The interface might not depend on Android versions. Please land the original patch, and I'll cleanup the code afterwards.
Attachment #8474474 - Flags: review?(tzimmermann) → review-
Attachment #8474474 - Attachment is obsolete: true
Attachment #8474277 - Attachment is obsolete: false
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/e3c48d54993d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S3 (29aug)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: