tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Identifying mob build via preprocessor


From: Alvarito050506
Subject: [Tinycc-devel] Identifying mob build via preprocessor
Date: Mon, 9 Aug 2021 22:20:48 -0300

Hello!

I'm currently using TCC for testing and experimenting because it's
blazing fast (amazing work, by the way), and some libraries depend on
GNU C features which are actually implemented in the `mob` branch, but
the libraries only check for GCC and Clang, so I would like to send a
few patches that would make them check for TCC > 0.9.27 too.

The problem is, as far as I know, there is currently no way to detect
a build from the `mob` branch, and using `__TINYC__` wouldn't an
option since it doesn't change anymore.

I made a small patch that defines `__TINYC_MOB__` as the number of
commits since 0.9.27, and could be used like the following:

/* Detect support for the cleanup attribute */
#if defined(__GNUC__) || defined(__clang__) ||
     defined(__TINYC_MOB__) && __TINYC_MOB__ >= 68
/* ... */

I wonder if there is a better way to do this, and if it would be OK to
add something like this?

Thanks,
Álvaro.

Attachment: tinyc_mob.patch
Description: Text Data


reply via email to

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