Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编译一些最初使用 GCC 为 SDCC 编写的 c 代码,以便在主机上运行一些单元测试。SDCC 有一些语言扩展,例如__xdataor __pdata(用于内存控制),它们应该保留给 SDCC,但在使用 GCC 编译时应该被忽略。我强烈不希望修改被测模块。有没有办法做到这一点?
__xdata
__pdata
我已经发现如果我#define __xdata在被测模块中添加类似的东西,它会起作用。因此,也许有可能有类似“全局定义”的东西?我对 GCC 的经验很少。也许有编译器标志可以帮助我?
#define __xdata
There are two compiler flags, you could use:
-include
-D__xdata=