This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: adding __COUNTER__ to gcc


olenz <lenz.oron@gmail.com> writes:

> I was trying to add __COUNTER__ support to the gcc compiler but my
> implementation (same as __LINE__) is not good for pre compiled headers.
> any idea how to implement this? one optiion is to add a global variable to
> each program, initialized to 0, and to replace the __COUNTER__ with
> something like (myGlobal++). any idea how do i add such a global varibale
> and use it later?

Look in libcpp/pch.c to see how the preprocessor saves and restores
its state when using PCH.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]