diff --git a/ndk/sources/android/libportable/common/include/log_portable.h b/ndk/sources/android/libportable/common/include/log_portable.h index f48780a9d..27f521e62 100644 --- a/ndk/sources/android/libportable/common/include/log_portable.h +++ b/ndk/sources/android/libportable/common/include/log_portable.h @@ -81,7 +81,8 @@ static inline char *portable_tag() { _rv; /* Returned to caller */ \ }) -# include +#if !defined(HAS_NO_LOG_H) +#include # define PERROR(str) { \ ALOGE("%s: PERROR('%s'): errno:%d:'%s'", __func__, str, errno, strerror(errno)); \ @@ -89,4 +90,9 @@ static inline char *portable_tag() { # define ASSERT(cond) ALOG_ASSERT(cond, "assertion failed:(%s), file: %s, line: %d:%s", \ #cond, __FILE__, __LINE__, __func__); +#else +# define PERROR(str) fprintf(stderr, "%s: PERROR('%s'): errno:%d:'%s'", __func__, str, errno, strerror(errno)) +# define ASSERT(cond) assert(cond) + +#endif \ No newline at end of file