oliverschmidt/cc65 — pull request #70 by dagit (2014-01-09 05:24:20+00:00)
Title: Changes neede to get things building under mingw

I had to make 3 changes to get cc65 building on windows under mingw. I haven't tested if it breaks the Visual Studio build, but I don't think it will. I also haven't tested on OSX/linux but I don't expect any breakage there either.

The first thing I changed is simple and shouldn't be controversial at all. The command line was too big for windows and so I added some make magic to break up the command line. That's the `max_args` macro.

The second change is less great, but should be fine. `tmpfile` on Windows requires root permissions. I found an MSDN article that said to use `tmpnam`/`fopen` instead. That fixed that problem. It's not terribly secure but hopefully C compilers are not installed in a way that security matters :)

The third change is not great. MinGW's C library doesn't support the `%m` format string so the calls to `Error` generate a warning that says `%m` is not a valid format string. Because of -Werror this was breaking the build. So I disabled -Werror. I think that's a bad thing. I would love to have a more specific flag to use here. We could disable the format string checking, but it's very useful. Maybe just disable it on mingw?

What do you think?

Thanks!