History

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.

YX Hao committed 7 years ago

Commit 756e7661 parent a4997bf1 file · +7 −3Browse files

Unified · Split

tccgen.c+7−3
@@ -7685,9 +7685,13 @@ static int decl0(int l, int is_for_loop_init, Sym *func_sym) · 7684 unmodified lines
76857685
76867686 #ifdef TCC_TARGET_PE
76877687 if (ad.a.dllimport || ad.a.dllexport) {
7688− if (type.t & (VT_STATIC|VT_TYPEDEF))
7689− tcc_error("cannot have dll linkage with static or typedef");
7690− if (ad.a.dllimport) {
7688+ if (type.t & VT_STATIC)
7689+ tcc_error("cannot have dll linkage with static");
7690+ if (type.t & VT_TYPEDEF) {
7691+ tcc_warning("'%s' attribute ignored for typedef",
7692+ ad.a.dllimport ? (ad.a.dllimport = 0, "dllimport") :
7693+ (ad.a.dllexport = 0, "dllexport"));
7694+ } else if (ad.a.dllimport) {
76917695 if ((type.t & VT_BTYPE) == VT_FUNC)
76927696 ad.a.dllimport = 0;
76937697 else

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t