Re: [PATCH v3 5/8] common.h: move non-compat specific macros and functions
- From
Calvin Wan <calvinwan@google.com>
- Date
- Jun 7, 2023, 17:02 UTC
- Message-ID
- <CAFySSZBZVn=7gBB19_uNxeUwS9Y8Q6ZZiCT=AwfuBy4+d34piw@mail.gmail.com>
- In-Reply-To
- <25d47081-2096-bb8a-dca3-bd5ea931c879@ramsayjones.plus.com>
Is there a particular problem here? common.h includes git-compat-util.h at the top so that it has access to standard libraries and possibly other compat utilities. git-compat-util.h includes common.h at the bottom so that other files don't have to also include common.h as well. Imagine if instead of having git-compat-util include common.h, we had a third file here: git-compat-common.h. It includes common.h and git-compat-util.h and every file includes that instead of git-compat-util.h. Now git-compat-util.h wouldn't include common.h, but this change can be circumvented by including common.h at the bottom.