ARMmbed / mbed-events

DEPRECATED! This project has moved to mbed-os
https://github.com/ARMmbed/mbed-os/tree/master/events
Apache License 2.0
11 stars 6 forks source link

Avoid name clashing #6

Closed pan- closed 8 years ago

pan- commented 8 years ago

Headers in this library should be prefixed otherwise they can easily clash with over headers. For instance events.h is too generic and can be taken by other libraries.

geky commented 8 years ago

I'm not opposed to changing the name, although I thought with the proposed mbed style (https://github.com/mbedmicro/mbed/issues/1939#issuecomment-235052835) we avoid these problems by including mbed-events/events.h.

Was there a specific problem cause by the name?

I'm assuming we would rename to mbed_events.h. Is there other headers we should rename?

0xc0170 commented 8 years ago

we avoid these problems by including mbed-events/events.h.

within our sw yes, we should, but does not protect us in the users space if they include just events.h :(

geky commented 8 years ago

Other event-loop libraries use similar names without problems:

This sounds to me like an issue with the user's code, not a problem we should be trying to solve. And a problem they only have to fix if they include the mbed-events library.

pan- commented 8 years ago

@geky I agree with you on most parts but the reality is that with our magnificent, refined and elaborated build system, every single path will be included in the compiler command line and every single C or C++ file (except the ones in specials directories) will be build.

Namespacing with "mbed-events/events.h" might not be enough and hardening libraries might be a good option for now.

geky commented 8 years ago

Let me know if you all find issues with https://github.com/ARMmbed/mbed-events/pull/7

This will be a pretty big breaking change, so I'm going to clump several name changes into a big version update.