diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt index 3febaac..02abc43 100644 --- a/tool/CMakeLists.txt +++ b/tool/CMakeLists.txt @@ -41,6 +41,17 @@ target_link_libraries(aaruformattool ICU::uc ) +# On Linux, enable GNU/POSIX feature test macros so functions like strerror_r +# and cfmakeraw are declared by system headers. We limit this to UNIX and not +# Apple (macOS provides these declarations differently). +if(UNIX AND NOT APPLE) + target_compile_definitions(aaruformattool PRIVATE + _GNU_SOURCE + _DEFAULT_SOURCE + _XOPEN_SOURCE=700) +endif() + + # On macOS/iOS, explicitly link the C++ standard library for ICU dependencies if(APPLE) target_link_libraries(aaruformattool PRIVATE "-lc++") diff --git a/tool/info.c b/tool/info.c index 80ee256..b14bc73 100644 --- a/tool/info.c +++ b/tool/info.c @@ -72,7 +72,7 @@ int info(const char *path) aaruformat_context *ctx = NULL; char *strBuffer = NULL; UErrorCode u_error_code = U_ZERO_ERROR; - uint i = 0; + uint32_t i = 0; mediaTagEntry const *mediaTag = NULL; mediaTagEntry const *tmpMediaTag = NULL; @@ -548,7 +548,7 @@ int info(const char *path) free(strBuffer); } - for(uint j = 0; j < ctx->dump_hardware_entries_with_data[i].entry.extents; j++) + for(uint32_t j = 0; j < ctx->dump_hardware_entries_with_data[i].entry.extents; j++) { printf("\t\tExtent %d:\n", j); printf("\t\t\tStart: %llu\n", ctx->dump_hardware_entries_with_data[i].extents[j].start);