Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 1 month ago.
mbed preprocessor definition
Does mbed have a preprocessor definition? I tried MBED, _MBED and _ _MBED, but none of them are defined.
For example.
#ifned MBED //This code is not compiled for mbed builds #endif
(I have no idea why I can't get that code block to work, and I'm not going to mess with it more after half a dozen tries)
Thanks.
1 Answer
10 years, 1 month ago.
Code tags need to be on their own line, otherwise they do not work.
__MBED__
Exists and is added by the build system (also when you export). In general you can export a project and see which defines are added. The library itself sets MBED_H and MBED_LIBRARY_VERSION (with a number).