core: fix compilation on SmartOS (bug #40981, closes #23)