Re: cpp hacking: bump FOO by 1

2020-09-03 Thread Hal Murray via devel
devel@ntpsec.org said: > In my example, the symbols are defined as enums, which handles the "bump FOO > by 1" issue straightforwardly. In general, enums are better ... Thanks. That's the step I missed. -- These are my opinions. I hate spam. _

Re: cpp hacking: bump FOO by 1

2020-09-03 Thread Fred Wright via devel
On Thu, 3 Sep 2020, Hal Murray wrote: I don't see how to use your master/entry macros to solve my problem. I didn't mean for those to be usable as is, but just as an illustration of the concept. YMMV. The current code has only one table but it needs a symbol for the offset of each slot

Re: cpp hacking: bump FOO by 1

2020-09-03 Thread Hal Murray via devel
Thanks. I don't see how to use your master/entry macros to solve my problem. The current code has only one table but it needs a symbol for the offset of each slot in the table. Those symbols are used in a giant select. I think I can rearrange the current code to avoid that select. The idea is

Re: cpp hacking: bump FOO by 1

2020-09-02 Thread Fred Wright via devel
On Sun, 30 Aug 2020, Hal Murray via devel wrote: Is there any way to do something like #define FOO $FOO+1 I want to keep track of the number of times a macro has been called. That seems like something that would happen often enough that there would be a standard recipe but I haven't seen it.

Re: cpp hacking: bump FOO by 1

2020-08-30 Thread ASSI via devel
Hal Murray via devel writes: > I want to keep track of the number of times a macro has been called. That > seems like something that would happen often enough that there would be a > standard recipe but I haven't seen it. (Or didn't recognize it.) You seem to be asking for the non-portable __C

cpp hacking: bump FOO by 1

2020-08-30 Thread Hal Murray via devel
Is there any way to do something like #define FOO $FOO+1 I want to keep track of the number of times a macro has been called. That seems like something that would happen often enough that there would be a standard recipe but I haven't seen it. (Or didn't recognize it.) -- The conte