(main) [_WIN32]: enable command line options for WIN32.
This commit is contained in:
parent
d2ae708dea
commit
2629b92102
1 changed files with 4 additions and 5 deletions
|
@ -67,6 +67,9 @@ static int quiet = 0;
|
||||||
#if defined(aix) || defined(linux) || defined(solaris)
|
#if defined(aix) || defined(linux) || defined(solaris)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif /* aix or linux */
|
#endif /* aix or linux */
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#include "../lib/gen/getopt.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -199,6 +202,7 @@ main(int argc, char *argv[])
|
||||||
rnd_seed = time(NULL);
|
rnd_seed = time(NULL);
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
rnd_seed += getpid();
|
rnd_seed += getpid();
|
||||||
|
#endif
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "ae:ioqs:R:")) != EOF) {
|
while ((opt = getopt(argc, argv, "ae:ioqs:R:")) != EOF) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
|
@ -225,7 +229,6 @@ main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
SRANDOM(rnd_seed);
|
SRANDOM(rnd_seed);
|
||||||
if (config_file == NULL) {
|
if (config_file == NULL) {
|
||||||
sprintf(tbuf, "%s/econfig", datadir);
|
sprintf(tbuf, "%s/econfig", datadir);
|
||||||
|
@ -233,11 +236,7 @@ main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
emp_config(config_file);
|
emp_config(config_file);
|
||||||
|
|
||||||
#if !defined(_WIN32)
|
|
||||||
parse_args(argc - optind, argv + optind);
|
parse_args(argc - optind, argv + optind);
|
||||||
#else
|
|
||||||
parse_args(argc - 1, argv + 1);
|
|
||||||
#endif
|
|
||||||
if (allocate_memory() == -1)
|
if (allocate_memory() == -1)
|
||||||
exit(-1);
|
exit(-1);
|
||||||
print_vars();
|
print_vars();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue