C++ Logo


Advanced search

Re: Undefining a compiler 's predefined macro

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Sun, 22 Mar 2020 16:40:57 +0200
On Sun, 22 Mar 2020 at 16:29, Edward Diener via Std-Discussion
<std-discussion_at_[hidden]> wrote:
> > So detect the predefine in one place and define your own macro in that
> > place depending on the predefine,
> > and use your own macro elsewhere.
> Exactly the original plan ! But this means in all the places where the
> predefined macro was being used the code has to be changed to use my own
> macro. Although that does not seem like it should be much work, the
> places the predefined macro are being used are maintained by others in
> git submodules, a PR has issued by me for each submodule, and then the
> maintainer of each submodule has to make the change to that submodule at
> his own leisure. Obviously the change itself is very simple. Whereas if
> I could have undefined the predefined macro when I know in the code it
> no longer has validity for all those other places, no change in the
> other code in those various submodules would have to be done at all.

Yes. You have a choice to make. Use a sane technique, or use a hack. :P

Received on 2020-03-22 09:43:58