Skip to content

Commit 3c6d43f

Browse files
pfalconAnas Nashif
authored andcommitted
include/zephyr.h: Define __ZEPHYR__ if not already.
__ZEPHYR__ preprocessor macro is a way for a (cross-platform) application to test if it's built for Zephyr. Currently it's defined by Makefile, so if an app uses it's own build system, it won't be available. So, define it in the standard header too to cover such a case. Change-Id: Id708d1f20fe3b415968ad8475da449f54ad3c3fb Signed-off-by: Paul Sokolovsky <[email protected]>
1 parent 5454df8 commit 3c6d43f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/zephyr.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
#ifndef _ZEPHYR__H
88
#define _ZEPHYR__H
99

10+
/*
11+
* Applications can identify whether they are built for Zephyr by
12+
* macro below. (It may be already defined by a makefile or toolchain.)
13+
*/
14+
#ifndef __ZEPHYR__
15+
#define __ZEPHYR__
16+
#endif
17+
1018
#include <kernel.h>
1119

1220
#ifdef CONFIG_MDEF

0 commit comments

Comments
 (0)