[ovs-dev] [PATCH 03/10] lib: Expose ovs_mutex and ovsthread_once in <openvswitch/thread.h>

Thomas Graf tgraf at noironetworks.com
Mon Dec 15 13:06:07 UTC 2014


On 12/11/14 at 06:47pm, Ben Pfaff wrote:
> On Tue, Dec 09, 2014 at 07:28:54PM +0100, Thomas Graf wrote:
> > This picks the ovs_mutex and ovsthread_once API from lib/ovs-thread.h
> > and exposes it in <openvswitch/thread.h>.
> > 
> > Signed-off-by: Thomas Graf <tgraf at noironetworks.com>
> 
> This adds a plain #include "util.h" into openvswitch/thread.h.  I don't
> remember the include path search rules well enough (or the order we add
> directories to it) to know whether this will find lib/util.h or
> include/openvswitch/util.h, but perhaps it should be written as
> "openvswitch/util.h" in any case.

I had the same question when I wrote these patches. The #include
"util.h" should include the header in lib/ first as desired  which
then includes the public header in include/openvswitch. This allows
split APIs into public and private parts without too much trouble.

>From the GCC docs:
https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html

GCC looks for headers requested with #include "file" first in the
directory containing the current file, then in the directories as
specified by -iquote options, then in the same places it would have
looked for a header requested with angle brackets.





More information about the dev mailing list