Logo
Explore Help
Register Sign In
OpenHarmony/third_party_mesa3d
2
0
Fork 0
You've already forked third_party_mesa3d
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
3370c5f90b537771d73af7783434c0758ea5de29
third_party_mesa3d/glcpp/tests/037-finalize-unexpanded-macro.c

4 lines
68 B
C
Raw Normal View History

Avoid re-expanding a macro name that has once been rejected from expansion. The specification of the preprocessor in C99 says that when we see a macro name that we are already expanding that we refuse to expand it now, (which we've done for a while), but also that we refuse to ever expand it later if seen in other contexts at which it would be legitimate to expand. We add a test case for that here, and fix it to work. The fix takes advantage of a new token_t value for tokens and argument words along with the recently added IDENTIFIER_FINALIZED token type which instructs the parser to not even look for another expansion.
2010-05-20 08:01:44 -07:00
#define expand(x) expand(x once)
#define foo(x) x
foo(expand(just))
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 51ms Template: 0ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API