core: moved `#include`s outside the `extern "C"` guards