clang 中的额外宏支持?
由于 LLVM/cLang 设计得特别好。
这似乎是增强 C/C++ 宏/预处理器系统的绝佳机会。
有谁知道
- Clang 或副项目添加了额外的宏/预处理器功能,
- 以使宏系统更强大(例如图灵完备)
注意:我问的是宏。不是 C++ 模板。我希望这个线程是特定于宏/预处理器的。
Since LLVM/cLang is especially well designed.
This seems like a great opportunity to augment the C/C++ macro/preprocessor system.
Does anyone know of
- additional macro/preprocessor abilities added by Clang or
- side projects to make the macro system more powerful (like turing complete)
Note: I am asking about macros. Not C++ templates. I want this thread to be macro/preprocessor specific.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LLVM/clang 设计得特别好。 clang 预处理器特别好:它跟踪宏扩展等。我怀疑它没有被扩展的原因是 1. 扩展的预处理器是非标准的,2. 没有人这样做。请随意扩展它。正如他们在 LLVM IRC 上所说:“欢迎补丁”,尽管我怀疑非常非标准的预处理器扩展可能不受欢迎。
有关将预处理器发挥到极致的示例,请查看 PL/1。 ;-)
LLVM/clang is especially well designed. The clang preprocessor is especially nice: It keeps track of macro expansions, etc. I suspect the reason that it has not been extended is that 1. An extended preprocessor is non-standard, and 2. No one has done it. Feel free to extend it. As they say on the LLVM IRC: "Patches are welcome", although I suspect that very non-standard preprocessor extensions may not be.
For an example of a preprocessor taken to the ultimate extreme, take a look at PL/1. ;-)
为什么不直接使用 M4 作为预处理器呢?
Why don't you just use M4 as a pre-preprocessor?