在C中取消定义类似函数的宏? [英] Undefine a function-like macro in C?
本文介绍了在C中取消定义类似函数的宏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试对glibc进行一些修改,我想知道是否可以重新定义类似函数的宏?
I am trying to do some hacks over the glibc, and I wanted to know whether it's possible to redefine function-like macros ?
例如,<tgmath.h>
具有以下宏:
#define expm1(Val) __TGMATH_UNARY_REAL_ONLY (Val, expm1)
如何将expm1
重新定义为:
#define expm1(Val) __TGMATH_UNARY_REAL_IMAG (Val, expm1, cexpm1)
我想我必须取消先前的定义,但我不知道该怎么做.
I suppose that I have to cancel the previous definition but I do not know exactly how to do that.
推荐答案
完全正确.只需先取消定义它即可.
Exactly. Just undefine it first.
#ifdef expm1
#undef expm1
#endif
#define expm1(Val) __TGMATH_UNARY_REAL_IMAG (Val, expm1, cexpm1)
这篇关于在C中取消定义类似函数的宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文