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
1 changed files with 7 additions and 3 deletions
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
|
#ifdef TCC_TARGET_PE
|
||||||
if (ad.a.dllimport || ad.a.dllexport) {
|
if (ad.a.dllimport || ad.a.dllexport) {
|
||||||
if (type.t & (VT_STATIC|VT_TYPEDEF))
|
if (type.t & VT_STATIC)
|
||||||
tcc_error("cannot have dll linkage with static or typedef");
|
tcc_error("cannot have dll linkage with static");
|
||||||
if (ad.a.dllimport) {
|
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)
|
if ((type.t & VT_BTYPE) == VT_FUNC)
|
||||||
ad.a.dllimport = 0;
|
ad.a.dllimport = 0;
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue