Thanks for your feedback. I agree that simply reordering the header order in bdb_layer.c would be the best approach.
Originally, I had an issue where by simply moving the standard library header includes below the "bdb_layer.h" include (which should mean the define logic should be reached before any of the standard library headers are included) the project failed to compile with a cryptic error:
but in the process of writing my response I've double checked my work and narrowed down the issue to requiring <sys/statvfs.h> be included in "ldap/servers/slapd/slap.h" for the code to compile correctly.
Hi Sergio,
Thanks for your feedback. I agree that simply reordering the header order in bdb_layer.c would be the best approach.
Originally, I had an issue where by simply moving the standard library header includes below the "bdb_layer.h" include (which should mean the define logic should be reached before any of the standard library headers are included) the project failed to compile with a cryptic error:
libtool: compile: gcc -DHAVE_CONFIG_H -I. -DRUST_ENABLE -DBUILD_ NUM=\"2024. 038.2016\ " "-DVENDOR=\"389 Project\"" -DBRAND=\"389\" -DCAPBRAND=\"389\" -UPACKAGE_VERSION -UPACKAGE_TARNAME -UPACKAGE_STRING -UPACKAGE_BUGREPORT -I./ldap/include -I./ldap/ servers/ slapd -I./include -I. -DLOCALSTATEDIR =\"/var\ " -DSYSCONFDIR= \"/etc\ " -DLIBDIR= \"/usr/ lib/x86_ 64-linux- gnu\" -DBINDIR= \"/usr/ bin\" -DDATADIR= \"/usr/ share\" -DDOCDIR= \"/usr/ share/doc/ 389-ds- base\" -DSBINDIR= \"/usr/ sbin\" -DPLUGINDIR= \"/usr/ lib/x86_ 64-linux- gnu/dirsrv/ plugins\ " -DTEMPLATEDIR= \"/usr/ share/dirsrv/ data\" -DSYSTEMSCHEMAD IR=\"/usr/ share/dirsrv/ schema\ " -DLOCALRUNDIR= \"/run\ " -DWITH_SYSTEMD -I/usr/include -I/usr/include/nss -I/usr/include/nspr -I/usr/include/nspr -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=3 -g -O2 -g -O2 -fno-omit- frame-pointer -mno-omit- leaf-frame- pointer -ffile- prefix- map=/<< PKGBUILDDIR> >=. -flto=auto -ffat-lto-objects -fstack- protector- strong -fstack- clash-protectio n -Wformat -Werror= format- security -fcf-protection -fdebug- prefix- map=/<< PKGBUILDDIR> >=/usr/ src/389- ds-base- 2.4.4+dfsg1- 1ubuntu1 -c ldap/servers/ slapd/back- ldbm/db- bdb/bdb_ ldif2db. c -fPIC -DPIC -o ldap/servers/ slapd/back- ldbm/db- bdb/.libs/ libback_ ldbm_la- bdb_ldif2db. o slapd/back- ldbm/db- bdb/../ back-ldbm. h:78,
from ldap/servers/ slapd/back- ldbm/db- bdb/bdb_ layer.h: 10,
from ldap/servers/ slapd/back- ldbm/db- bdb/bdb_ layer.c: 13: servers/ slapd/slap. h:544:20: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token servers/ slapd/slap. h:544:20: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token
In file included from ldap/servers/
./ldap/
544 | #define f_type f_un.f_un_type
| ^
./ldap/
544 | #define f_type f_un.f_un_type
but in the process of writing my response I've double checked my work and narrowed down the issue to requiring <sys/statvfs.h> be included in "ldap/servers/ slapd/slap. h" for the code to compile correctly.