From 8d9b83bd11353776d58820fbe6a510928c4ce3b4 Mon Sep 17 00:00:00 2001 From: Christian Jullien Date: Sun, 21 Jun 2020 09:53:52 +0200 Subject: [PATCH] macOS configure correctly reports clang and version --- configure | 1 + conftest.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/configure b/configure index 1f50a53..c762ea3 100755 --- a/configure +++ b/configure @@ -55,6 +55,7 @@ case $targetos in Darwin) confvars="$confvars OSX" tcc_usrinclude="`xcrun --show-sdk-path`/usr/include" + cc="clang" DLLSUF=".dylib" ;; Windows_NT|MINGW*|MSYS*|CYGWIN*) diff --git a/conftest.c b/conftest.c index 14babf0..255ebb3 100644 --- a/conftest.c +++ b/conftest.c @@ -66,12 +66,21 @@ int main(int argc, char *argv[]) break; } #ifdef __GNUC__ +#ifdef __clang__ + case 'm': + printf("%d\n", __clang_minor__); + break; + case 'v': + printf("%d\n", __clang_major__); + break; +#else case 'm': printf("%d\n", __GNUC_MINOR__); break; case 'v': printf("%d\n", __GNUC__); break; +#endif #elif defined __TINYC__ case 'v': puts("0");