The way that this is done in shoes is with a native.h that contains
method signatures like shoes_native_draw_widget, and then
native/win32.c and native/osx.c both implement the method. Conditional
compilation hooks up the right .c file for the platform.

I'm not familiar enough with what Ruby's needs actually are, just
offering one way that this is done.