[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Circular #include between lstate.h and ltm.h
- From: Andrew Gierth <andrew@...>
- Date: Wed, 23 May 2018 14:18:30 +0100
>>>>> "Jon" == Jon Chesterfield <jonathanchesterfield@gmail.com> writes:
Jon> Good point, well made. ltm.h uses nothing from lstate.h.
Except as already pointed out, it does use G(l) from lstate.h.
Nothing breaks in the build because ltm.h is included nowhere that
doesn't also include lstate.h first, and in any event the G() is only in
a macro expansion so it would only fail if something used the macro
without also having included lstate.h.
But in fact the inclusion of lstate.h in ltm.h is pointless, because if
you tried to include ltm.h on its own, this would happen:
1. ltm.h defines ltm_h
2. ltm.h includes lstate.h
3. lstate.h includes ltm.h
4. nested include of ltm.h does nothing, because ltm_h is already
defined
5. lstate.h fails on undefined TM_N
--
Andrew.