osx - How to undefine system function-like macros? -
i'm trying build code defines method howmany()
.
in osx there function-like macro same name in /usr/include/sys/types.h
#define howmany(x, y) __darwin_howmany(x, y)
following a previous question, i've tried including #undef
in header file
#ifdef howmany #undef howmany /*undefining '/usr/include/sys/types.h' */ #endif
but function-like macro remains active.
/usr/include/sys/types.h:184:9: note: macro 'howmany' defined here #define howmany(x, y) __darwin_howmany(x, y) /* # y's == x bits? */
how should deactivate function-like macro?
this incredibly fragile. yes, can work, small changes how things imported cause fail again (or worse, call wrong code). need make sure #undef
included in every file might include types.h
, it's undefined after it's defined. many ways can break. rename function. name taken.
Comments
Post a Comment