Better MSVC support

* get rid of alloca()
* no variable-sized arrays
This commit is contained in:
Heng Li
2017-09-03 11:05:55 -04:00
parent 2b8681ead7
commit 6db9b7579c
6 changed files with 22 additions and 20 deletions
+4
View File
@@ -11,12 +11,16 @@ int optind=1, opterr=1, optopt, __optpos, optreset=0;
static void __getopt_msg(const char *a, const char *b, const char *c, size_t l)
{
FILE *f = stderr;
#if !defined(WIN32) && !defined(_WIN32)
flockfile(f);
#endif
fputs(a, f);
fwrite(b, strlen(b), 1, f);
fwrite(c, 1, l, f);
fputc('\n', f);
#if !defined(WIN32) && !defined(_WIN32)
funlockfile(f);
#endif
}
int getopt(int argc, char * const argv[], const char *optstring)