tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] #if defined(TCC_TARGET_ARM64) || defined(TCC_TARGET_X86_6


From: Christian Jullien
Subject: [Tinycc-devel] #if defined(TCC_TARGET_ARM64) || defined(TCC_TARGET_X86_64) looks more releated to 64bit than to a specific architecture.
Date: Mon, 17 Oct 2016 06:54:18 +0200

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]