Handle always_inline as GNU inline
commitf18f8651599e1162c87b809d5c262b618dea4a9e
authorMichael Matz <matz@suse.de>
Fri, 22 May 2020 03:17:02 +0000 (22 05:17 +0200)
committerMichael Matz <matz@suse.de>
Sat, 20 Jun 2020 20:14:56 +0000 (20 22:14 +0200)
tree6af4cfa0c8d0731e60473a1caab010da2ba27bc2
parent5d2f4cb4038696f93e1f2819da010d29f741fbac
Handle always_inline as GNU inline

this is needed for multi-file testcases using stdio.h, as
the __sputc function is implemented as a extern inline
function (with gnu_inline attribute, but we don't support that for now).

Without this change that leads to multiply defined symbols when using
multiple units including stdio.h.

It also has an always_inline attribute, which we can use to guide our
behaviour, as in ISO-C an always_inline can't be defined with ISO
'extern inline' semantics.  This is the minimal change and not a full
implementation of GNU inline semantics, which would require thorough
testcases.

If __clang__ would be defined the header would make use of C99 semantics,
which would work for us.  It would also do that if _GNUC_ wouldn't be
defined.  But we can't do the latter (as the whole MacOSX SDK refuses
to be compiled with anything not defining that).  I haven't tested
defining __clang__, but suspect that's going to be problematic.
tcc.h
tccgen.c
tcctok.h