From 9d322d6268b8d3122907a4e1cdf4f8369174c429 Mon Sep 17 00:00:00 2001 From: "Emden R. Gansner" Date: Thu, 15 Aug 2013 14:05:59 -0400 Subject: [PATCH] Fix getopt usage for Windows --- cmd/gvmap/gvmap.c | 6 ++++-- cmd/mingle/minglemain.c | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cmd/gvmap/gvmap.c b/cmd/gvmap/gvmap.c index 201789d21..3f07ac7c3 100644 --- a/cmd/gvmap/gvmap.c +++ b/cmd/gvmap/gvmap.c @@ -65,8 +65,6 @@ static char swork[maxlen]; #pragma comment( lib, "gvortho.lib" ) #pragma comment( lib, "sfdp.lib" ) #pragma comment( lib, "rbtree.lib" ) - - #endif /* not WIN32_DLL */ @@ -306,6 +304,7 @@ init(int argc, char **argv, params_t* pm) /* bbox_margin[0] = bbox_margin[1] = -0.2;*/ pm->bbox_margin[0] = pm->bbox_margin[1] = 0; + opterr = 0; while ((c = getopt(argc, argv, ":evODko:m:s:r:p:c:C:l:b:g:t:a:h:z:d:")) != -1) { switch (c) { case 'm': @@ -430,6 +429,9 @@ init(int argc, char **argv, params_t* pm) if (pm->plot_label) free (pm->plot_label); pm->plot_label = strdup (optarg); break; + case ':': + fprintf(stderr, "gvpack: option -%c missing argument - ignored\n", optopt); + break; case '?': if (optopt == '?') usage(cmd, 0); diff --git a/cmd/mingle/minglemain.c b/cmd/mingle/minglemain.c index 3e0dae064..90c3705e9 100644 --- a/cmd/mingle/minglemain.c +++ b/cmd/mingle/minglemain.c @@ -14,8 +14,15 @@ #ifdef WIN32 /*dependencies*/ #pragma comment( lib, "cgraph.lib" ) + #pragma comment( lib, "gvc.lib" ) #pragma comment( lib, "ingraphs.lib" ) -#endif + #pragma comment( lib, "sparse.lib" ) + #pragma comment( lib, "sfdp.lib" ) + #pragma comment( lib, "minglelib.lib" ) + #pragma comment( lib, "neatogen.lib" ) + #pragma comment( lib, "rbtree.lib" ) + #pragma comment( lib, "common.lib" ) +#endif /* not WIN32_DLL */ #include #include @@ -71,6 +78,7 @@ static void init(int argc, char *argv[], opts_t* opts) unsigned int c; char* CmdName = argv[0]; + opterr = 0; opts->outer_iter = 4; #ifdef HAVE_ANN opts->method = METHOD_INK_AGGLOMERATE; -- 2.40.0