On 04.08.2023 16:09, Nicola Vetrini wrote: >>> 3. One possible resolution pattern is including 'acglobal.h' twice >>> (either directly or indirectly trough acpi.h, if >>> the latter does not cause other issues) like so: >>> >>> (assuming DEFINE_ACPI_GLOBALS is undefined here) >>> #include "acglobal.h" >>> #define DEFINE_ACPI_GLOBALS >>> #include "acglobal.h" >>> >>> this way, the rule is followed properly, though it's not the >>> prettiest >>> pattern and also clashes with the objectives >>> of D4.10 ("Precautions shall be taken in order to prevent the >>> contents >>> of a header file being included >>> more than once"), but then a motivated exception is allowed there. >> >> Not really sure about this one. > > If you can tell me more about why that header is defined the way it is > (i.e. why it's used twice with > DEFINE_ACPI_GLOBALS #defined and the other times without), maybe we can > come up > with better alternatives.
The "Why?" question can only be answered by the ACPICA folks who originally made it like this. Linux inherited the file from there, and we inherited it from Linux. See also Stefano's reply on the matter. My guess is that the goal was to have just a single place that needs changing (besides consumer sites, where changes may or may not be necessary) if the type of a variable needs to be adjusted. Jan