From 41a1e23abf809fae3e233bf77b164dd04850ed97 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 25 Dec 2022 13:06:02 +0100 Subject: [PATCH] Remove -ansi and make it compile under TCC --- CMakeLists.txt | 2 +- src/util.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aabc3af..ba60d21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ set_target_properties(minitar PROPERTIES C_STANDARD_REQUIRED ON) if (MSVC) target_compile_options(minitar PRIVATE /W4 /WX) else() - target_compile_options(minitar PRIVATE -Wall -Wextra -pedantic -Werror -ansi) + target_compile_options(minitar PRIVATE -Wall -Wextra -pedantic -Werror) endif() install(TARGETS minitar DESTINATION lib) diff --git a/src/util.c b/src/util.c index 7d1bbd3..93ea2a0 100644 --- a/src/util.c +++ b/src/util.c @@ -3,10 +3,15 @@ #include "tar.h" #include #include -#include #include -#ifndef _MSC_VER +#ifndef __TINYC__ +#include +#else +#define noreturn _Noreturn +#endif + +#if !defined(_MSC_VER) && !defined(__TINYC__) #define WEAK __attribute__((weak)) #else #define WEAK