initial C89 changes and windows support