mirror of
https://github.com/frida/tinycc
synced 2024-12-24 22:16:49 +03:00
win: ignore dllimport/dllexport for typedef with warning instead of error
Keep the same as gcc and clang. The usage exists in MinGW-w64 headers.
This commit is contained in:
parent
a4997bf3d9
commit
756e766295
10
tccgen.c
10
tccgen.c
@ -7685,9 +7685,13 @@ static int decl0(int l, int is_for_loop_init, Sym *func_sym)
|
||||
|
||||
#ifdef TCC_TARGET_PE
|
||||
if (ad.a.dllimport || ad.a.dllexport) {
|
||||
if (type.t & (VT_STATIC|VT_TYPEDEF))
|
||||
tcc_error("cannot have dll linkage with static or typedef");
|
||||
if (ad.a.dllimport) {
|
||||
if (type.t & VT_STATIC)
|
||||
tcc_error("cannot have dll linkage with static");
|
||||
if (type.t & VT_TYPEDEF) {
|
||||
tcc_warning("'%s' attribute ignored for typedef",
|
||||
ad.a.dllimport ? (ad.a.dllimport = 0, "dllimport") :
|
||||
(ad.a.dllexport = 0, "dllexport"));
|
||||
} else if (ad.a.dllimport) {
|
||||
if ((type.t & VT_BTYPE) == VT_FUNC)
|
||||
ad.a.dllimport = 0;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user