Rewrote Alex Bligh's pull request so that it matches the coding style of this project and it should now compile with MSVC, which is not C99 compliant (i.e., doesn't support mixing of statements and declarations).
cfaef07