History

tccpe: #pragma pack(push) - support this form

grischka committed 5 years ago

Commit e97e1081 parent c7a57bf1 file · +6 −2Browse files

Unified · Split

tccpp.c+6−2
@@ -1725,6 +1725,7 @@ static void pragma_parse(TCCState *s1) · 1724 unmodified lines
17251725 /* This may be:
17261726 #pragma pack(1) // set
17271727 #pragma pack() // reset to default
1728+ #pragma pack(push) // push current
17281729 #pragma pack(push,1) // push & set
17291730 #pragma pack(pop) // restore previous */
17301731 next();
@@ -1743,8 +1744,10 @@ static void pragma_parse(TCCState *s1) · 12 unmodified lines
17431744 next();
17441745 if (s1->pack_stack_ptr >= s1->pack_stack + PACK_STACK_SIZE - 1)
17451746 goto stk_error;
1746− s1->pack_stack_ptr++;
1747− skip(',');
1747+ val = *s1->pack_stack_ptr++;
1748+ if (tok != ',')
1749+ goto pack_set;
1750+ next();
17481751 }
17491752 if (tok != TOK_CINT)
17501753 goto pragma_err;
@@ -1753,6 +1756,7 @@ static void pragma_parse(TCCState *s1) · 2 unmodified lines
17531756 goto pragma_err;
17541757 next();
17551758 }
1759+ pack_set:
17561760 *s1->pack_stack_ptr = val;
17571761 }
17581762 if (tok != ')')

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