Having only a look at tccgen.c  I see #if related to an architecture (which
is of course Ok) but but more and more often

#if defined(TCC_TARGET_ARM64) || defined(TCC_TARGET_X86_64)

.

#else

#endif

 

Which are used to generate code related to word / int / long / long long
processor size.

 

I recently fixed and added:

 

    /* TinyCC & gcc defines */

#if defined(TCC_TARGET_PE) && defined(TCC_TARGET_X86_64)

    /* 64bit Windows. */

    tcc_define_symbol(s, "__SIZE_TYPE__", "unsigned long long");

    tcc_define_symbol(s, "__PTRDIFF_TYPE__", "long long");

    tcc_define_symbol(s, "__LLP64__", NULL);

#elif defined(TCC_TARGET_X86_64) || defined(TCC_TARGET_ARM64)

    /* Other 64bit systems. */

    tcc_define_symbol(s, "__SIZE_TYPE__", "unsigned long");

    tcc_define_symbol(s, "__PTRDIFF_TYPE__", "long");

    tcc_define_symbol(s, "__LP64__", NULL);

#else

    /* Other 32bit systems. */

    tcc_define_symbol(s, "__SIZE_TYPE__", "unsigned long");

    tcc_define_symbol(s, "__PTRDIFF_TYPE__", "long");

    tcc_define_symbol(s, "__ILP32__", NULL);

#endif

 

Which is widely used (gcc VC++) to describe relation between int/long/long
long/ptr.

IMHO using those macros better describes the intent.

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to