Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

Using mbed.h instead of direct include of blockdevice #38

Closed
wants to merge 1 commit into from

Conversation

bridadan
Copy link
Contributor

@bridadan bridadan commented Aug 8, 2018

BlockDevice was brought into the mbed namespace with ARMmbed/mbed-os#7663.

This breaks the current "direct include" of BlockDevice.h that is currently in use. This PR moves to including mbed.h so the namespace is used correctly. This should be backwards compatible with previous releases of Mbed OS as well.

@bridadan
Copy link
Contributor Author

bridadan commented Aug 8, 2018

@dlfryar reports this is a good fix!

@dlfryar-zz
Copy link

+1 looks good solved issues encountered when PR #7663 moved the namespace

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 9, 2018

This repo does not use any of the mbed namespace therfore 7663 caused a breakage (good use case for this change - it's breaking for someone!).

Looking at the fix here, not certain that include "mbed.h" everywhere is a fix. Is this repository used as one of the modules? Adding mbed.h might cause conflicts for other modules and increase compilation time. I would propose something similar to http://www.gotw.ca/publications/migrating_to_namespaces.htm.

For the cpp files here, using mbed::BlockDevice after includes. and in the header files, do mbed::Blockdevice (not using there), similar to what PR #39 did.

This change comes with 5.10

@bridadan
Copy link
Contributor Author

bridadan commented Aug 9, 2018

Thanks for the tip @0xc0170! I'll update the PR to use the namespace.

@bridadan
Copy link
Contributor Author

bridadan commented Aug 9, 2018

Actually, looks like #39 already did it the better way, may be we can just take that one? Closing this for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants