diff --git a/configure.ac b/configure.ac index 0d9bf865a..f4658d528 100644 --- a/configure.ac +++ b/configure.ac @@ -137,24 +137,17 @@ case ${host_os} in *darwin*) OPENTHREAD_TARGET=darwin - OPENTHREAD_TARGET_DEFINES="-DOPENTHREAD_TARGET_DARWIN" ;; *linux*) OPENTHREAD_TARGET=linux - OPENTHREAD_TARGET_DEFINES="-DOPENTHREAD_TARGET_LINUX" ;; esac -AC_SUBST(OPENTHREAD_TARGET_DARWIN) AM_CONDITIONAL([OPENTHREAD_TARGET_DARWIN], [test "${OPENTHREAD_TARGET}" = "darwin"]) - -AC_SUBST(OPENTHREAD_TARGET_LINUX) AM_CONDITIONAL([OPENTHREAD_TARGET_LINUX], [test "${OPENTHREAD_TARGET}" = "linux"]) -AC_SUBST(OPENTHREAD_TARGET_DEFINES) - # # Checks for build host programs # diff --git a/examples/platforms/gp712/uart-posix.c b/examples/platforms/gp712/uart-posix.c index fee2e217c..e98c97719 100644 --- a/examples/platforms/gp712/uart-posix.c +++ b/examples/platforms/gp712/uart-posix.c @@ -43,13 +43,13 @@ #include "utils/code_utils.h" -#ifdef OPENTHREAD_TARGET_LINUX +#ifdef __linux__ #include int posix_openpt(int oflag); int grantpt(int fildes); int unlockpt(int fd); char *ptsname(int fd); -#endif // OPENTHREAD_TARGET_LINUX +#endif // __linux__ static uint8_t s_receive_buffer[128]; static const uint8_t *s_write_buffer; @@ -104,7 +104,7 @@ otError otPlatUartEnable(void) otError error = OT_ERROR_NONE; struct termios termios; -#ifdef OPENTHREAD_TARGET_LINUX +#ifdef __linux__ // Ensure we terminate this process if the // parent process dies. prctl(PR_SET_PDEATHSIG, SIGHUP); diff --git a/examples/platforms/simulation/uart.c b/examples/platforms/simulation/uart.c index 1160a33f6..ab8262646 100644 --- a/examples/platforms/simulation/uart.c +++ b/examples/platforms/simulation/uart.c @@ -44,13 +44,13 @@ #include "utils/code_utils.h" #if OPENTHREAD_SIMULATION_VIRTUAL_TIME_UART == 0 -#ifdef OPENTHREAD_TARGET_LINUX +#ifdef __linux__ #include int posix_openpt(int oflag); int grantpt(int fildes); int unlockpt(int fd); char *ptsname(int fd); -#endif // OPENTHREAD_TARGET_LINUX +#endif // __linux__ static uint8_t s_receive_buffer[128]; static const uint8_t *s_write_buffer; @@ -83,7 +83,7 @@ otError otPlatUartEnable(void) otError error = OT_ERROR_NONE; struct termios termios; -#ifdef OPENTHREAD_TARGET_LINUX +#ifdef __linux__ // Ensure we terminate this process if the // parent process dies. prctl(PR_SET_PDEATHSIG, SIGHUP); diff --git a/src/core/common/debug.hpp b/src/core/common/debug.hpp index 344d8a75d..ba15fde76 100644 --- a/src/core/common/debug.hpp +++ b/src/core/common/debug.hpp @@ -41,7 +41,7 @@ #if OPENTHREAD_CONFIG_ASSERT_ENABLE -#if defined(OPENTHREAD_TARGET_DARWIN) || defined(OPENTHREAD_TARGET_LINUX) +#if defined(__APPLE__) || defined(__linux__) #include