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

Portability improvements with libbsd 0.3.0


One of the main motivations when creating the libbsd library was to
ease porting source code with strong BSD origins by needing to patch
them less, and to reduce code duplication in other projects. So if
there are functions, macros or declarations commonly found on the BSDs
that your packages need, I'd gladly consider adding them in libbsd
upstream so that the patch delta in those packages can be reduced (bug
reports in Debian or upstream would be fine). The upstream project
can be found at <http://libbsd.freedesktop.org>.

With this particular release (0.3.0) there's now support to
transparently overlay the BSD portability layer on top of the system
one, so one needs to perform even less patching to the code. To do so
a new pkg-config libbsd-overlay file is available, which will give
the correct compilation flags. As in, for example:

  pkg-config --cflags libbsd-overlay

Code that previously had to do something like this, say, to get the
prototype for strlcpy(3):

  #include <string.h>
  #include <bsd/string.h>

Can now be just left alone as if it was on a BSD system:

  #include <string.h>

For existing packages using libbsd-dev (BCCed), several headers will
be removed in the upcoming 0.4.0 upstream release. To test that your
packages will keep building fine, you can temporarily define the
preprocessor macro LIBBSD_DISABLE_DEPRECATED, which will force the
build to fail, otherwise only warnings are emitted in some cases.


Reply to: