Actually, ```#undefine resolve_symlink``` will not work, since I need ```lock_file``` to use the ```mingw_resolve_symlink``` version which is just below the ```resolve_symlink()``` here. 

I think that the current solution is the simplest.  I can comment it if you need to?
```c
/* mingw requires its own version of resolve_symlink to be used. */
#ifndef resolve_symlink
```
I'm not sure I can come up with a smaller patch set to be honest.