resolve conflict with windef.h macros and remove implicit cast