From c6cbcea963e75609584a415e6d7ad54b688f0b74 Mon Sep 17 00:00:00 2001 From: Timerix22 Date: Thu, 5 May 2022 14:19:12 +0300 Subject: [PATCH] std c17 --- Makefile | 6 +++--- base/std.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7433d24..f6c333c 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,9 @@ TESTS=$(wildcard tests/*c) $(wildcard tests/**/*.c) OUTDIR=bin CMP=gcc OPT_ARGS=-O2 -flto -WARN_ARGS=-Wall -Wno-discarded-qualifiers +WARN_ARGS=-Wall -Wno-discarded-qualifiers -std=c17 -all: clear_c clear_bin build_test build_test_dbg build_lib build_dll +all: clear_c clear_bin build_test build_lib clear_c: clear @@ -17,7 +17,7 @@ clear_bin: mkdir $(OUTDIR) clang: CMP=clang -clang: WARN_ARGS=-Wall -Wno-ignored-qualifiers -Wno-incompatible-pointer-types-discards-qualifiers +clang: WARN_ARGS=-Wall -Wno-ignored-qualifiers -Wno-incompatible-pointer-types-discards-qualifiers -std=c17 clang: all ###################################### diff --git a/base/std.h b/base/std.h index a2415d2..4607014 100644 --- a/base/std.h +++ b/base/std.h @@ -31,6 +31,9 @@ extern "C" { #else #define CALL #endif + #ifndef typeof + #define typeof __typeof__ + #endif #else #pragma GCC error "unknown compiler" #endif