<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 4, 2022 at 10:04 AM Kim Barrett <<a href="mailto:kim.barrett@oracle.com">kim.barrett@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> On Jul 4, 2022, at 3:55 AM, Kim Barrett <<a href="mailto:kim.barrett@oracle.com" target="_blank">kim.barrett@oracle.com</a>> wrote:<br>
> <br>
>> On Jul 4, 2022, at 3:18 AM, Thomas Stüfe <<a href="mailto:thomas.stuefe@gmail.com" target="_blank">thomas.stuefe@gmail.com</a>> wrote:One thing that I dislike is that this requires including globalDefinitions.hpp. Not every cpp or hpp file may include that. Also, since in theory, to have 100% coverage, every file and header should include globalDefinitions.hpp, we may want to move these macros into an own file to avoid blowing up the dependencies.<br>
> <br>
> I thought about putting the forbiddings in a different file, but ultimately decided not.<br>
> <br>
> 1. globalDefinitions.hpp ends up being included nearly everywhere anyway, almost certainly in places<br>
> where these functions would be used. It’s currently such a dumping ground for miscellaneous and<br>
> often unrelated things that it ends up being hard to avoid.<br>
> <br>
> 2. globalDefinitions.hpp is where we do whatever conditionalization is needed to #include a lot of<br>
> the relevant “system” and C library headers and perform some additional massaging of them.<br>
> These poisonings may involve parameter and return types from those headers.<br>
<br>
One option is to put it in a separate file and use gcc's `-include` option to ensure it is included<br>
everywhere. But (2) is still an issue, so other refactoring of globalDefinitions.hpp would also<br>
be needed. (Not that such refactoring would be a bad thing, IMO.)<br>
<br></blockquote><div><br></div><div>I also realized that we almost always need macros.hpp for platform dependent switch macros. It is probably okay as it is. Maybe we could add a rule to the style guide saying that every cpp file should include globalDefinitions.hpp, similar to windows.h on Windows.</div><div><br></div><div>But the mechanism is already very good. I can live with it as it is now.</div><div><br></div><div> </div></div></div>