diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 78fc5d1..c7b8287 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,13 +13,12 @@ add_subdirectory(../deps/fmgen fmgen) if (ANDROID) add_library(system3 SHARED) - find_library(ndk_log log) target_sources(system3 PRIVATE android/nact_android.cpp android/mako.cpp ) - target_link_libraries(system3 PRIVATE SDL2 SDL2_ttf fmgen ${ndk_log}) + target_link_libraries(system3 PRIVATE SDL2 SDL2_ttf fmgen) elseif (EMSCRIPTEN) add_executable(system3) diff --git a/src/common.h b/src/common.h index 0e32d87..1bc168f 100644 --- a/src/common.h +++ b/src/common.h @@ -12,10 +12,6 @@ #include #include -#ifdef __ANDROID__ -#include -#endif - #ifdef EMSCRIPTEN #include #define SDL_Delay emscripten_sleep @@ -31,25 +27,11 @@ typedef int8_t int8; typedef int16_t int16; typedef int32_t int32; -#ifdef __ANDROID__ - #define ERROR(fmt, ...) \ - __android_log_print(ANDROID_LOG_ERROR, "System3", "(%s:%d): " fmt, __func__, __LINE__, ##__VA_ARGS__) + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__) #define WARNING(fmt, ...) \ - __android_log_print(ANDROID_LOG_WARN, "System3", "(%s:%d): " fmt, __func__, __LINE__, ##__VA_ARGS__) -#define NOTICE(fmt, ...) \ - __android_log_print(ANDROID_LOG_INFO, "System3", fmt, ##__VA_ARGS__) - -#else // __ANDROID__ - -#define ERROR(fmt, ...) \ - fprintf(stderr, "*ERROR*(%s:%d): " fmt "\n", __func__, __LINE__, ##__VA_ARGS__) -#define WARNING(fmt, ...) \ - fprintf(stderr, "*WARNING*(%s:%d): " fmt "\n", __func__, __LINE__, ##__VA_ARGS__) -#define NOTICE(fmt, ...) \ - fprintf(stderr, fmt "\n", ##__VA_ARGS__) - -#endif // __ANDROID__ + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__) +#define NOTICE SDL_Log #ifndef WIN32