Re: Checking if code is compiled for Zephyr


Paul Sokolovsky
 

On Tue, 7 Mar 2017 14:38:16 +0000
Marcus Shawcroft <marcus.shawcroft@gmail.com> wrote:

On 7 March 2017 at 14:35, Paul Sokolovsky
<paul.sokolovsky@linaro.org> wrote:
Hello,

I'm trying to #ifdef a part of cross-platform code for Zephyr, and I
didn't find a clear, self-describing way to do so. Am I missing
something? Can we have something like __ZEPHYR__, _ZEPHYR of
whatever preprocessor macro to check for?
The toplevel Makefile hardwires:

-D__ZEPHYR__=1
Cool, thanks for replies! I grepped include/* for anything like that, I
checked predefined macros in gcc. Who'd new I should grep Makefiles
too ;-).


I don't know if that symbol is documented somewhere, but it would be
nice if it was.
+1. doc/* doesn't mention it, I'll see where it fits and drop a patch
on occasion.


--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog

Join devel@lists.zephyrproject.org to automatically receive all group messages.