Thread (11 messages) 11 messages, 3 authors, 2021-03-17

Re: [libgpiod][PATCH 6/6] core: hide the GPIOD_API symbol

From: Bartosz Golaszewski <hidden>
Date: 2021-03-09 15:19:58

On Tue, Mar 9, 2021 at 4:07 PM Andy Shevchenko
[off-list ref] wrote:
On Tue, Mar 09, 2021 at 02:26:39PM +0100, Bartosz Golaszewski wrote:
quoted
From: Bartosz Golaszewski <redacted>

GPIOD_API is unneccesarily polluting the user-facing headers. There's no
advantage to having it in public files. Let's make them internal to the
library. Upcoming modifications will also make GPIOD_BIT() redundant so
we'll be able to remove all macros unrelated to the main functionality
from gpiod.h.
quoted
-libgpiodcxx_la_SOURCES = chip.cpp iter.cpp line.cpp line_bulk.cpp
+libgpiodcxx_la_SOURCES = chip.cpp internal.h iter.cpp line.cpp line_bulk.cpp
Don't we have something like _HEADERS ?
_HEADERS is for headers that are installed. Headers for internal use
should be defined as part of sources in autotools.
...
quoted
+#include "internal.hpp"
I forgot C++ approximately when I tried it first time :-)
But I'm confused between this and above file name. Do we have *.h and *.hpp
with the same name?
Yes, internal.h is used by the core C library and lives in lib/,
internal.hpp is for C++ (it will grow because we'll have to share some
symbols between classes in the future with the new API) and lives in
bindings/cxx/.

Bart
...
quoted
-libgpiod_la_SOURCES = core.c helpers.c misc.c uapi/gpio.h
+libgpiod_la_SOURCES = core.c helpers.c internal.h misc.c uapi/gpio.h
As above.

--
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help