use explicit long to replace int32_t to fix conflicts from leap.h