macOS configure correctly reports clang and version

This commit is contained in:
Christian Jullien 2020-06-21 09:53:52 +02:00
parent ba8980f492
commit 8d9b83bd11
2 changed files with 10 additions and 0 deletions

1
configure vendored
View File

@ -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*)

View File

@ -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");