better warning if compiled as console app under Windows

This commit is contained in:
h_vogt 2011-07-08 20:41:53 +00:00
parent 7d7274d124
commit d609107127
2 changed files with 15 additions and 7 deletions

View File

@ -1,3 +1,7 @@
2011-07-08 Holger Vogt
* display.c: replace error message by appropriate warning, if compiled
as console application under MS Windows
2011-07-04 Holger Vogt
* input.c: add ssize_t as SSIZE_T for MS Visual Studio

View File

@ -169,15 +169,19 @@ DevInit(void)
#endif
if (!dispdev) {
externalerror(
"no graphics interface;\n please check if X-server is running, \n or ngspice is compiled properly (see INSTALL)");
dispdev = FindDev("error");
/* console application under MS Windows */
#if !defined(HAS_WINDOWS) && !defined(TCL_MODULE) && (defined(_MSC_VER) || defined(__MINGW32__))
fprintf(cp_err, "Warning: no graphics interface!\n You may use command 'gnuplot'\n if GnuPlot is installed.\n");
#else
externalerror(
"no graphics interface;\n please check if X-server is running,\n or ngspice is compiled properly (see INSTALL)");
#endif
dispdev = FindDev("error");
} else if (dispdev->Init()) {
fprintf(cp_err,
"Warning: can't initialize display device for graphics.\n");
dispdev = FindDev("error");
fprintf(cp_err,
"Warning: can't initialize display device for graphics.\n");
dispdev = FindDev("error");
}
}
/* NewViewport is responsible for filling in graph->viewport */