Use uinptr_t as the type of ud. Instead of void* and intptr_t.