[posix-app] fix undefined config macro warnings (#4458)

This commit is contained in:
Abtin Keshavarzian
2020-01-09 11:45:39 -08:00
committed by Jonathan Hui
parent cf809bd16a
commit b853231920
6 changed files with 45 additions and 0 deletions
+8
View File
@@ -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
+8
View File
@@ -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>
+11
View File
@@ -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!"
+4
View File
@@ -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;
+10
View File
@@ -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_
+4
View File
@@ -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;