Merge pull request #1832 from acqn/PPDefineFix

[cc65] Preprocessor directive #define fixes
This commit is contained in:
Bob Andrews
2022-08-20 14:27:25 +02:00
committed by GitHub
2 changed files with 180 additions and 126 deletions

25
test/val/bug1822-pptest.c Normal file
View File

@@ -0,0 +1,25 @@
/* Bug #1822 - Redefined macros failed to be all undefined with a single #undef */
#undef F
#undef F
#define F 1
#define F 1
#undef F
#if defined F
#error #undef F fails!
#endif
#define F 0
#include <stdio.h>
int main(void)
{
if (F != 0)
{
printf("failed: F = %d\n", F);
}
return F;
}