approach 1: single header file with lots of ifdefs
with some trickiness, don't need casting