Re: Checking if code is compiled for Zephyr

Paul Sokolovsky

On Tue, 7 Mar 2017 17:01:04 +0100
Paul Sokolovsky <> wrote:

On Tue, 7 Mar 2017 14:38:16 +0000
Marcus Shawcroft <> wrote:

On 7 March 2017 at 14:35, Paul Sokolovsky
<> wrote:

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:

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 ;-).
Well, too early. I do build against Zephyr, I use its configuration and
includes, but my 3rd party project doesn't use Zephyr *Makefiles*.
So, __ZEPHYR__ isn't available.

I'll prepare a patch.

Best Regards,
Paul | Open source software for ARM SoCs
Follow Linaro:!/linaroorg -

Join to automatically receive all group messages.