Added `#ifdef __cplusplus` to support compilation via g++