在 2024-12-12 21:31, Martin Storsjö 写道:
Interesting idea. But it is better than the explicit undefining of malloc macro? The advantage of pragma solution is that it contains explicit "#if defined(_DEBUG) && defined(_CRTDBG_MAP_ALLOC)" guard which describe why it is needed. Parenthesis solution around malloc does not explicitly describe why and when it is needed.I have no strong opinion either way here, I'm fine with either (malloc) or the pragma push_macro/ undef solution.
pushing/popping macros is what Microsoft headers do, so it should be preferred. Also, putting a name in parentheses doesn't prevent expansion of an object-like macro.
-- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public