Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert if __ZEPHYR__ to if defined(__ZEPHYR__) #29172

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/system/SystemConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
#error "FORBIDDEN: CHIP_SYSTEM_CONFIG_MULTICAST_HOMING CAN ONLY BE USED WITH SOCKET IMPL"
#endif

#if CHIP_SYSTEM_CONFIG_MULTICAST_HOMING && CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__
#if CHIP_SYSTEM_CONFIG_MULTICAST_HOMING && CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__)
#error "FORBIDDEN: CHIP_SYSTEM_CONFIG_MULTICAST_HOMING WAS NOT TESTED WITH ZEPHYR"
#endif

Expand Down Expand Up @@ -639,7 +639,7 @@ struct LwIPEvent;
* Defaults to enabled if the system is using sockets (except for Zephyr RTOS).
*/
#ifndef CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE
#if (CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK) && !__ZEPHYR__ && !__MBED__
#if (CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK) && !defined(__ZEPHYR__) && !defined(__MBED__)
#define CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE 1
#else
#define CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE 0
Expand All @@ -658,7 +658,7 @@ struct LwIPEvent;
* Defaults to enabled on Zephyr platforms using sockets
*/
#ifndef CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__)
#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS 1
#else
#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS 0
Expand All @@ -679,7 +679,7 @@ struct LwIPEvent;
* Defaults to enabled on Zephyr platforms using sockets
*/
#ifndef CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__)
#define CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API 1
#else
#define CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API 0
Expand All @@ -695,7 +695,7 @@ struct LwIPEvent;
* Defaults to enabled on Zephyr platforms using sockets
*/
#ifndef CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__)
#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF 1
#else
#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF 0
Expand All @@ -711,7 +711,7 @@ struct LwIPEvent;
* Defaults to enabled on Unix/Linux platforms using sockets
*/
#ifndef CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS
#if (CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK) && !__ZEPHYR__
#if (CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK) && !defined(__ZEPHYR__)
#define CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS 1
#else
#define CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS 0
Expand All @@ -727,7 +727,7 @@ struct LwIPEvent;
* Defaults to enabled on Zephyr platforms that do not enable Zephyr POSIX layer.
*/
#ifndef CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKETS
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__ && CONFIG_NET_SOCKETS_POSIX_NAMES
#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__) && CONFIG_NET_SOCKETS_POSIX_NAMES
#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKETS 1
#else
#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKETS 0
Expand Down Expand Up @@ -759,7 +759,7 @@ struct LwIPEvent;
* Defaults to enabled on Zephyr platforms that enable CONFIG_EVENTFD.
*/
#ifndef CHIP_SYSTEM_CONFIG_USE_ZEPHYR_EVENTFD
#if __ZEPHYR__ && CONFIG_EVENTFD
#if defined(__ZEPHYR__) && CONFIG_EVENTFD
#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_EVENTFD 1
#else
#define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_EVENTFD 0
Expand Down
2 changes: 1 addition & 1 deletion src/system/SystemError.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern const char * DescribeErrorPOSIX(CHIP_ERROR code);
extern void RegisterPOSIXErrorFormatter();
extern bool FormatPOSIXError(char * buf, uint16_t bufSize, CHIP_ERROR err);

#if __ZEPHYR__
#ifdef __ZEPHYR__
extern CHIP_ERROR MapErrorZephyr(int code);
#endif // __ZEPHYR__

Expand Down
Loading