improve MSVC support

- clip spaces on __attribute__((weak)) so we can catch it with a #define
- add #define at top for MSVC substitution