monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] internal API changes - no more split_path, new rules fo


From: Zack Weinberg
Subject: [Monotone-devel] internal API changes - no more split_path, new rules for header files
Date: Wed, 27 Jun 2007 17:17:54 -0700

As of revision ee12b229666086fc1d3609d47a77d996af017b00 which I just
pushed to monotone.ca, there are two important changes to the internal
APIs which everyone should be aware of.

First, there is no longer any such thing as a split_path.  Use
file_path instead.  If there is something you're trying to do that was
easy with split_path but too hard with file_path's, even with its new
methods, please let me know and we can work it out.  I would like to
think that this change will be met with universal rejoicing, but I am
often wrong when I think that.

Second, while making those changes, I finally gave into the temptation
to introduce a special must-include-first header file to the source
tree.  Allow me to quote the new paragraph of HACKING:

| There is a special header file, base.hh, that should be the very first
| #include in every .cc file, without exception.  It makes a small
| number of inclusions and declarations that we want to be globally
| visible.  Do not include this header in any other header file;
| however, in header files, assume the contents of base.hh are already
| visible.  "make distcheck" will verify that these rules are followed.
| If you modify base.hh, make sure you keep the "audit-includes" script
| consistent with it.  Try not to add things to base.hh; it's intended
| to be a minimal set of declarations that really do need to be visible
| everywhere.

The present contents of base.hh are: the BOOST_DISABLE_THIS_AND_THAT
defines that used to be on the compiler command line; includes for
config.h, <string>, and <iosfwd>; the base dump template; and the
NORETURN macro.  In my opinion, having a special "first" header like
this is a more comprehensible way of ensuring that all those
declarations are visible everywhere than any other option I could
think of.  Please do feel free to come up with a better idea.

zw




reply via email to

[Prev in Thread] Current Thread [Next in Thread]