From 37920b6476d9c03e8e162284ce9d7f820df7ee92 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Fri, 10 Mar 2023 00:45:56 +0100 Subject: [PATCH] adjustments --- core/CMakeLists.txt | 1 + core/src/utils/flog.cpp | 2 +- core/src/utils/net.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index bcf0495a..59d38fc3 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -13,6 +13,7 @@ endif (USE_BUNDLE_DEFAULTS) file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c") add_definitions(-DSDRPP_IS_CORE) +add_definitions(-DFLOG_ANDROID_TAG="SDR++") if (MSVC) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) endif () diff --git a/core/src/utils/flog.cpp b/core/src/utils/flog.cpp index 9243ef71..d19c6e94 100644 --- a/core/src/utils/flog.cpp +++ b/core/src/utils/flog.cpp @@ -169,7 +169,7 @@ namespace flog { fprintf(outStream, "] %s\n", out.c_str()); #elif defined(__ANDROID__) // Print format string - __android_log_buf_print(LOG_ID_DEFAULT, TYPE_PRIORITIES[type], FLOG_ANDROID_TAG, COLOR_WHITE "[%02d/%02d/%02d %02d:%02d:%02d.%03d] [%s%s" COLOR_WHITE "] %s\n", + __android_log_print(TYPE_PRIORITIES[type], FLOG_ANDROID_TAG, COLOR_WHITE "[%02d/%02d/%02d %02d:%02d:%02d.%03d] [%s%s" COLOR_WHITE "] %s\n", nowc->tm_mday, nowc->tm_mon + 1, nowc->tm_year + 1900, nowc->tm_hour, nowc->tm_min, nowc->tm_sec, 0, TYPE_COLORS[type], TYPE_STR[type], out.c_str()); #else // Print format string diff --git a/core/src/utils/net.cpp b/core/src/utils/net.cpp index ec4511bf..10fdaa71 100644 --- a/core/src/utils/net.cpp +++ b/core/src/utils/net.cpp @@ -288,8 +288,8 @@ namespace net { // Save data for (auto iface = addresses; iface; iface = iface->ifa_next) { - if (iface->ifa_addr->sa_family != AF_INET) { continue; } if (!iface->ifa_addr || !iface->ifa_netmask) { continue; } + if (iface->ifa_addr->sa_family != AF_INET) { continue; } InterfaceInfo info; info.address = ntohl(*(uint32_t*)&iface->ifa_addr->sa_data[2]); info.netmask = ntohl(*(uint32_t*)&iface->ifa_netmask->sa_data[2]);