Closed aleasims closed 6 months ago
@akokoshn @makxenov expecting you to comment
I vote for the original Google recommendation, because removing some specific parts may be confusing. For example, someone takes ZKLLVM_ASSIGNER_ASSIGNER_HPP_
as a example and adds ZKLLVM_ASSIGNER_SEGMENT_HPP_
, omitting the intermediate mem
directory. I don't see a problem with longer include guards.
Agree: <PROJECT>_<PATH>_<FILE>_H_
looks like best solution
Current state
We have a really messy include guards at the moment actually. E.g.
assigner.hpp
has:which doesn't make any sense at all now. Some of the files have something mixed like:
which is also a bit confusing. So it's really hard to say, which style we use in this project.
Using
CRYPTO3_ASSIGNER
doesn't makes any sense for me: there is nothing related tocrypto3
here.assigner
is not a part ofcrypto3
.Suggestion
There are some style guides like this one from Google, which proposes
<PROJECT>_<PATH>_<FILE>_H_
. So it may be:We probably may expect, that prefix
ZKLLVM_ASSIGNER_
is good enough for the uniqueness on user side. So we probably can omitinclude/nil/blueprint
part of the path. At the end we will have this:So out include guards may look like
<PROJECT>_<PATH_FROM_HEADERS_DIR>_<FILE>_HPP_
.Examples: