Metaclass in FFIlibrary implemented in a portable way