How to use a macro in an #include directive?(如何在#include 指令中使用宏?)
问题描述
我对如何在 #include
指令中使用宏感到困惑.我已经这样做了:
I'm confused on how to use macros in the #include
directive. I've done this:
GlobalDefintions.h:
但给我的是这样的:
有没有办法成功地将 ARCH_FAMILY_S
和 ARCH_S
附加到我的 #include
指令字符串?
Is there a way to successfully append ARCH_FAMILY_S
and ARCH_S
to my #include
directive string?
推荐答案
您可以使用一系列宏来创建包含文件.不幸的是,我想不出任何更清洁(源内)的方式来做到这一点.这适用于 arm-eabi-none-gcc
v5.4.1.
You can use a series of macros to create your include file. Unfortunately, I can't think of any cleaner (in-source) way of doing this. This works for arm-eabi-none-gcc
v5.4.1.
这篇关于如何在#include 指令中使用宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!