Adding the include to the relevant file (slap.h) seems to have addressed the compilation error and allows for simply rearranging the includes in the source file as you suggested.
Frankly, I'm still unsure why that specific include bypasses the compilation error at all, but I've attached a new diff.
Looking through the upstream bug reports, all I found was: https:/ /github. com/389ds/ 389-ds- base/issues/ 5962
which doesn't seem immediately related.
Adding the include to the relevant file (slap.h) seems to have addressed the compilation error and allows for simply rearranging the includes in the source file as you suggested.
Frankly, I'm still unsure why that specific include bypasses the compilation error at all, but I've attached a new diff.