some cleanups related to recent commits

- configure/Makefile : cleanup, really use CC_NAME
- tccasm.c : remove C99 construct that MSVC doesn't compile
- arm-gen.c, x86_64-gen.c, riscv64-gen.c, tccmacho.c : ditto
- arm64-gen.c: commit 383acf8eff wrote:
  "Instead of a cast, it would be better to pass the exact type."
  It is true that there are better solutions but it is not
  passing the exact type (I think).
- tcctest.c: revert "fix cast test for clang" 03646ad46f
  this obviously wants to test non-portable conversions
- 114_bound_signal.test: clock_nanosleep is too new for older
  linuxes, just use sleep() instead
This commit is contained in:
grischka
2020-06-27 17:22:04 +02:00
parent 0ee4989ed3
commit 72277967ff
16 changed files with 124 additions and 155 deletions

View File

@@ -61,48 +61,57 @@ int main(int argc, char *argv[])
_setmode(_fileno(stdout), _O_BINARY); /* don't translate \n to \r\n */
#endif
switch(argc == 2 ? argv[1][0] : 0) {
case 'b':
case 'b'://igendian
{
volatile unsigned foo = 0x01234567;
puts(*(unsigned char*)&foo == 0x67 ? "no" : "yes");
break;
}
#if defined(__clang__)
case 'm':
case 'm'://inor
printf("%d\n", __clang_minor__);
break;
case 'v':
case 'v'://ersion
printf("%d\n", __clang_major__);
break;
#elif defined(__TINYC__)
case 'v':
case 'v'://ersion
puts("0");
break;
case 'm':
case 'm'://inor
printf("%d\n", __TINYC__);
break;
#elif defined(_MSC_VER)
case 'v'://ersion
puts("0");
break;
case 'm'://inor
printf("%d\n", _MSC_VER);
break;
#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
/* GNU comes last as other compilers may add 'GNU' compatibility */
case 'm':
case 'm'://inor
printf("%d\n", __GNUC_MINOR__);
break;
case 'v':
case 'v'://ersion
printf("%d\n", __GNUC__);
break;
#else
case 'm':
case 'v':
case 'm'://inor
case 'v'://ersion
puts("0");
break;
#endif
case 't':
case 't'://riplet
puts(TRIPLET);
break;
case 'c':
case 'c'://ompiler
#if defined(__clang__)
puts("clang");
#elif defined(__TINYC__)
puts("tcc");
#elif defined(_MSC_VER)
puts("msvc");
#elif defined(__GNUC__)
puts("gcc");
#else