mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 09:57:47 +00:00
[posix-app] fix undefined config macro warnings (#4458)
This commit is contained in:
committed by
Jonathan Hui
parent
cf809bd16a
commit
b853231920
@@ -30,6 +30,14 @@
|
||||
|
||||
#include <openthread/platform/toolchain.h>
|
||||
|
||||
#ifndef HAVE_LIBEDIT
|
||||
#define HAVE_LIBEDIT 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LIBREADLINE
|
||||
#define HAVE_LIBREADLINE 0
|
||||
#endif
|
||||
|
||||
#define OPENTHREAD_USE_READLINE (HAVE_LIBEDIT || HAVE_LIBREADLINE)
|
||||
|
||||
#if HAVE_LIBEDIT
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef HAVE_LIBEDIT
|
||||
#define HAVE_LIBEDIT 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LIBREADLINE
|
||||
#define HAVE_LIBREADLINE 0
|
||||
#endif
|
||||
|
||||
#if HAVE_LIBEDIT || HAVE_LIBREADLINE
|
||||
#if HAVE_LIBEDIT
|
||||
#include <editline/readline.h>
|
||||
|
||||
@@ -42,6 +42,14 @@
|
||||
#include <sys/prctl.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LIBEDIT
|
||||
#define HAVE_LIBEDIT 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_LIBREADLINE
|
||||
#define HAVE_LIBREADLINE 0
|
||||
#endif
|
||||
|
||||
#define OPENTHREAD_POSIX_APP_TYPE_NCP 1
|
||||
#define OPENTHREAD_POSIX_APP_TYPE_CLI 2
|
||||
|
||||
@@ -51,11 +59,14 @@
|
||||
#include <openthread/platform/radio.h>
|
||||
#if OPENTHREAD_POSIX_APP_TYPE == OPENTHREAD_POSIX_APP_TYPE_NCP
|
||||
#include <openthread/ncp.h>
|
||||
#define OPENTHREAD_USE_CONSOLE 0
|
||||
#elif OPENTHREAD_POSIX_APP_TYPE == OPENTHREAD_POSIX_APP_TYPE_CLI
|
||||
#include <openthread/cli.h>
|
||||
#if (HAVE_LIBEDIT || HAVE_LIBREADLINE) && !OPENTHREAD_ENABLE_POSIX_APP_DAEMON
|
||||
#define OPENTHREAD_USE_CONSOLE 1
|
||||
#include "console_cli.h"
|
||||
#else
|
||||
#define OPENTHREAD_USE_CONSOLE 0
|
||||
#endif
|
||||
#else
|
||||
#error "Unknown posix app type!"
|
||||
|
||||
@@ -44,6 +44,10 @@
|
||||
|
||||
#include <openthread/error.h>
|
||||
|
||||
#ifndef __SANITIZE_ADDRESS__
|
||||
#define __SANITIZE_ADDRESS__ 0
|
||||
#endif
|
||||
|
||||
#if __SANITIZE_ADDRESS__ != 0
|
||||
|
||||
static uint32_t sState = 1;
|
||||
|
||||
@@ -55,4 +55,14 @@
|
||||
#define OPENTHREAD_POSIX_APP_SOCKET_BASENAME "/tmp/openthread"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_POSIX_VIRTUAL_TIME
|
||||
*
|
||||
* This setting configures whether to use virtual time.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_POSIX_VIRTUAL_TIME
|
||||
#define OPENTHREAD_POSIX_VIRTUAL_TIME 0
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_PLATFORM_CONFIG_H_
|
||||
|
||||
@@ -391,6 +391,10 @@ void otPlatSettingsWipe(otInstance *aInstance)
|
||||
VerifyOrDie(0 == ftruncate(sSettingsFd, 0), OT_EXIT_ERROR_ERRNO);
|
||||
}
|
||||
|
||||
#ifndef SELF_TEST
|
||||
#define SELF_TEST 0
|
||||
#endif
|
||||
|
||||
#if SELF_TEST
|
||||
|
||||
uint64_t gNodeId = 1;
|
||||
|
||||
Reference in New Issue
Block a user