From d7e291c53a5b02f70032d25ee2ac66f93b6daa44 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 23 Mar 2013 09:54:44 +0100 Subject: [PATCH] HAS_WINDOWS --> HAS_WINGUI allow compilation on MS Windows without GUI --- configure.ac | 2 +- src/frontend/com_ghelp.c | 2 +- src/frontend/com_hardcopy.c | 2 +- src/frontend/com_sysinfo.c | 2 +- src/frontend/cpitf.c | 2 +- src/frontend/display.c | 8 ++++---- src/frontend/error.c | 4 ++-- src/frontend/inp.c | 4 ++-- src/frontend/inpcom.c | 2 +- src/frontend/measure.c | 4 ++-- src/frontend/misccoms.c | 2 +- src/frontend/numparam/mystring.c | 2 +- src/frontend/outitf.c | 6 +++--- src/frontend/parser/input.c | 4 ++-- src/frontend/postcoms.c | 2 +- src/frontend/rawfile.c | 2 +- src/frontend/resource.c | 10 +++++----- src/frontend/signal_handler.c | 4 ++-- src/frontend/spec.c | 2 +- src/frontend/spec.h | 2 +- src/frontend/wdisp/windisp.c | 4 ++-- src/frontend/wdisp/winprint.c | 4 ++-- src/include/ngspice/ngspice.h | 2 +- src/main.c | 22 +++++++++++----------- src/maths/cmaths/cmath1.c | 2 +- src/maths/sparse/spoutput.c | 2 +- src/misc/alloc.c | 6 +++--- src/misc/ivars.c | 2 +- src/misc/util.c | 2 +- src/nghelp.c | 12 ++++++------ src/spicelib/analysis/acan.c | 6 +++--- src/spicelib/analysis/cktop.c | 4 ++-- src/spicelib/analysis/cktsetup.c | 4 ++-- src/spicelib/analysis/dcpss.c | 4 ++-- src/spicelib/analysis/dctran.c | 4 ++-- src/spicelib/analysis/dctrcurv.c | 6 +++--- src/spicelib/devices/dev.c | 10 +++++----- src/spicelib/parser/inppas2.c | 8 ++++---- src/winmain.c | 4 ++-- visualc/include/ngspice/config.h | 2 +- 40 files changed, 89 insertions(+), 89 deletions(-) diff --git a/configure.ac b/configure.ac index 7efbe4dab..89353ec88 100644 --- a/configure.ac +++ b/configure.ac @@ -467,7 +467,7 @@ AC_MSG_CHECKING([whether windows code is enabled]) AC_ARG_WITH([windows], [AS_HELP_STRING([--with-windows], [MS WINDOWS executable])], [if test "x$with_windows" = xyes; then - AC_DEFINE([HAS_WINDOWS], [1], [define to specify MS Windows executable]) + AC_DEFINE([HAS_WINGUI], [1], [define to specify MS Windows executable]) fi], [with_windows=no]) AC_MSG_RESULT([$with_windows]) diff --git a/src/frontend/com_ghelp.c b/src/frontend/com_ghelp.c index cf958f6f6..f3c57b80e 100644 --- a/src/frontend/com_ghelp.c +++ b/src/frontend/com_ghelp.c @@ -73,7 +73,7 @@ com_ghelp(wordlist *wl) hlp_main(path, wl); return; #endif /* X_DISPLAY_MISSING 1 */ -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI printf("Internal help is no longer avaialable!\n"); printf("Please check for the actual ngspice manual at\n"); printf("http://ngspice.sourceforge.net/docs/ngspice-manual.pdf\n"); diff --git a/src/frontend/com_hardcopy.c b/src/frontend/com_hardcopy.c index 464d74e9c..76cdaf8f1 100644 --- a/src/frontend/com_hardcopy.c +++ b/src/frontend/com_hardcopy.c @@ -59,7 +59,7 @@ com_hardcopy(wordlist *wl) // PushGraphContext(currentgraph); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI if (!wl && hc_button) { char *psfname; GRAPH *tempgraph; diff --git a/src/frontend/com_sysinfo.c b/src/frontend/com_sysinfo.c index 1e531d727..5a72a150f 100644 --- a/src/frontend/com_sysinfo.c +++ b/src/frontend/com_sysinfo.c @@ -13,7 +13,7 @@ #include "com_commands.h" /* We might compile for Windows, but only as a console application (e.g. tcl) */ -#if defined(HAS_WINDOWS) || defined(__MINGW32__) || defined(_MSC_VER) +#if defined(HAS_WINGUI) || defined(__MINGW32__) || defined(_MSC_VER) #define HAVE_WIN32 #endif diff --git a/src/frontend/cpitf.c b/src/frontend/cpitf.c index 2b3f34302..cfb1706d3 100644 --- a/src/frontend/cpitf.c +++ b/src/frontend/cpitf.c @@ -268,7 +268,7 @@ ft_cpinit(void) found = TRUE; break; -#if defined(HAS_WINDOWS) || defined(__MINGW32__) || defined(_MSC_VER) +#if defined(HAS_WINGUI) || defined(__MINGW32__) || defined(_MSC_VER) /* search in local directory where ngspice.exe resides */ #if defined TCL_MODULE } else if ((fp = fopen("./tclspinit", "r")) != NULL) { diff --git a/src/frontend/display.c b/src/frontend/display.c index 4d8fac37b..304924dda 100644 --- a/src/frontend/display.c +++ b/src/frontend/display.c @@ -28,7 +28,7 @@ static int nodev(void); #include "plotting/x11.h" #endif -#ifdef HAS_WINDOWS /* Graphic-IO under MS Windows */ +#ifdef HAS_WINGUI /* Graphic-IO under MS Windows */ #include "wdisp/windisp.h" //#include "wdisp/winprint.h" #endif @@ -60,7 +60,7 @@ DISPDEVICE device[] = { gen_DatatoScreen,}, #endif -#ifdef HAS_WINDOWS /* Graphic-IO under MS Windows */ +#ifdef HAS_WINGUI /* Graphic-IO under MS Windows */ { "Windows", 0, 0, 1000, 1000, 0, 0, WIN_Init, WIN_NewViewport, WIN_Close, WIN_Clear, @@ -174,7 +174,7 @@ DevInit(void) #endif -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI if (!dispdev) dispdev = FindDev("Windows"); #endif @@ -187,7 +187,7 @@ DevInit(void) if (!dispdev) { -#if !defined(HAS_WINDOWS) && !defined(TCL_MODULE) && (defined(_MSC_VER) || defined(__MINGW32__)) +#if !defined(HAS_WINGUI) && !defined(TCL_MODULE) && (defined(_MSC_VER) || defined(__MINGW32__)) /* console application under MS Windows */ fprintf (cp_err, diff --git a/src/frontend/error.c b/src/frontend/error.c index 3113c2593..a69d62cd8 100644 --- a/src/frontend/error.c +++ b/src/frontend/error.c @@ -17,7 +17,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group char ErrorMessage[1024]; -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI void winmessage(char *new_msg); #endif @@ -25,7 +25,7 @@ void winmessage(char *new_msg); void controlled_exit(int status) { -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI if (status) winmessage("Fatal error in NGSPICE"); #else diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 00c98a63b..4bf839a28 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -54,7 +54,7 @@ static void cktislinear(CKTcircuit *ckt, struct line *deck); void line_free_x(struct line *deck, bool recurse); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI void SetAnalyse(char *Analyse, int Percent); #endif @@ -497,7 +497,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) Go on if there is something left after the controls.*/ if (deck->li_next) { fprintf(cp_out, "\nCircuit: %s\n\n", tt); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI SetAnalyse("Prepare Deck", 0); #endif /* Now expand subcircuit macros and substitute numparams.*/ diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 63b4d4981..ba1d37ff5 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -897,7 +897,7 @@ inp_pathopen(char *name, char *mode) char buf[BSIZE_SP]; struct variable *v; -#if defined(HAS_WINDOWS) +#if defined(HAS_WINGUI) char buf2[BSIZE_SP]; /* search in the path where the source (input) file has been found, but only if "name" is just a file name */ diff --git a/src/frontend/measure.c b/src/frontend/measure.c index d5f58eccb..6a6833f71 100644 --- a/src/frontend/measure.c +++ b/src/frontend/measure.c @@ -26,7 +26,7 @@ static wordlist *measure_parse_line(char *line); extern bool ft_batchmode; extern bool rflag; -#ifdef HAS_WINDOWS /* hvogt 10.03.99, nach W. Mues */ +#ifdef HAS_WINGUI /* hvogt 10.03.99, nach W. Mues */ extern void SetAnalyse(char *Analyse, int Percent); #endif @@ -225,7 +225,7 @@ do_measure( wordlist *measure_word_list; int precision = measure_get_precision(); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI if (!chk_only) SetAnalyse("meas", 0); #endif diff --git a/src/frontend/misccoms.c b/src/frontend/misccoms.c index 9461af044..68bcf39a0 100644 --- a/src/frontend/misccoms.c +++ b/src/frontend/misccoms.c @@ -219,7 +219,7 @@ com_version(wordlist *wl) #ifdef USE_OMP fprintf(cp_out, "** OpenMP multithreading for BSIM3, BSIM4 enabled\n"); #endif -#if defined(X_DISPLAY_MISSING) && !defined(HAS_WINDOWS) +#if defined(X_DISPLAY_MISSING) && !defined(HAS_WINGUI) fprintf(cp_out, "** X11 interface not compiled into ngspice\n"); #endif #ifdef NOBYPASS diff --git a/src/frontend/numparam/mystring.c b/src/frontend/numparam/mystring.c index 02bf5150b..daa716929 100644 --- a/src/frontend/numparam/mystring.c +++ b/src/frontend/numparam/mystring.c @@ -13,7 +13,7 @@ #include #include "ngspice/config.h" -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #include "ngspice/wstdio.h" #endif diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index 7e3511f69..439e01b98 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -458,7 +458,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr) /* While we're looking at the reference value, print it to the screen every quarter of a second, to give some feedback without using too much CPU time */ -#ifndef HAS_WINDOWS +#ifndef HAS_WINGUI currclock = clock(); if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) { fprintf(stderr, " Reference value : % 12.5e\r", @@ -471,7 +471,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr) /* And the same for a non-complex value */ fileAddRealValue(run->fp, run->binary, refValue->rValue); -#ifndef HAS_WINDOWS +#ifndef HAS_WINGUI currclock = clock(); if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) { fprintf(stderr, " Reference value : % 12.5e\r", @@ -552,7 +552,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr) /* This is interactive mode. Update the screen with the reference variable just the same */ -#ifndef HAS_WINDOWS +#ifndef HAS_WINGUI currclock = clock(); if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) { if (run->isComplex) { diff --git a/src/frontend/parser/input.c b/src/frontend/parser/input.c index 697c078b2..e91711700 100644 --- a/src/frontend/parser/input.c +++ b/src/frontend/parser/input.c @@ -17,7 +17,7 @@ Author: 1988 Jeffrey M. Hsu #ifdef _MSC_VER #include "BaseTsd.h" /* for SSIZE_T */ #define ssize_t SSIZE_T -#ifndef HAS_WINDOWS +#ifndef HAS_WINGUI #define read _read /* only for console */ #endif #endif @@ -31,7 +31,7 @@ Author: 1988 Jeffrey M. Hsu int inchar(FILE *fp) { -#ifndef HAS_WINDOWS +#ifndef HAS_WINGUI char c; ssize_t i; diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index b1a198d31..99a957cfb 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -906,7 +906,7 @@ static void DelPlotWindows(struct plot *pl) { /* do this only if windows or X11 is defined */ -#if defined(HAS_WINDOWS) || !defined(X_DISPLAY_MISSING) +#if defined(HAS_WINGUI) || !defined(X_DISPLAY_MISSING) GRAPH *dgraph; int n; /* find and remove all graph structures derived from a given plot */ diff --git a/src/frontend/rawfile.c b/src/frontend/rawfile.c index 7553f927b..4ccf4082d 100644 --- a/src/frontend/rawfile.c +++ b/src/frontend/rawfile.c @@ -25,7 +25,7 @@ int raw_prec = -1; /* How many sigfigs to use, default 15 (max). */ #define DEFPREC 15 -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #undef fscanf /* redo I/O from WINMAIN.C here otherwise reading ASCII will not work */ #endif diff --git a/src/frontend/resource.c b/src/frontend/resource.c index e839fc83e..177255082 100644 --- a/src/frontend/resource.c +++ b/src/frontend/resource.c @@ -33,7 +33,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #endif /* We might compile for Windows, but only as a console application (e.g. tcl) */ -#if defined(HAS_WINDOWS) || defined(__MINGW32__) || defined(_MSC_VER) +#if defined(HAS_WINGUI) || defined(__MINGW32__) || defined(_MSC_VER) #define HAVE_WIN32 #endif @@ -176,7 +176,7 @@ ft_ckspace(void) return; old_usage = usage; -#endif /* not HAS_WINDOWS */ +#endif /* not HAS_WINGUI */ if ((double)usage > (double)limit * 0.9) { fprintf(cp_err, "Warning - approaching max data size: "); @@ -362,7 +362,7 @@ printres(char *name) fprintmem(cp_out, all_memory.dt * 1024); fprintf(cp_out, ".\n"); */ #endif /* HAVE__PROC_MEMINFO */ -#else /* HAS_WINDOWS or HAVE__PROC_MEMINFO */ +#else /* HAS_WINGUI or HAVE__PROC_MEMINFO */ fprintf(cp_out, "Current dynamic memory usage = "); fprintmem(cp_out, usage); fprintf(cp_out, ",\n"); @@ -495,7 +495,7 @@ fprintmem(FILE *stream, unsigned long long memory) { static int get_procm(struct proc_mem *memall) { #if defined(_MSC_VER) || defined(__MINGW32__) -#if (_WIN32_WINNT >= 0x0500) && defined(HAS_WINDOWS) +#if (_WIN32_WINNT >= 0x0500) && defined(HAS_WINGUI) /* Use Windows API function to obtain size of memory - more accurate */ HANDLE hProcess; PROCESS_MEMORY_COUNTERS pmc; @@ -525,7 +525,7 @@ static int get_procm(struct proc_mem *memall) { memall->size = 0; /* sure, it is more */ memall->resident = 0; memall->trs = 0; -#endif /* _WIN32_WINNT 0x0500 && HAS_WINDOWS */ +#endif /* _WIN32_WINNT 0x0500 && HAS_WINGUI */ #else /* Use Linux/UNIX /proc//statm file information */ FILE *fp; diff --git a/src/frontend/signal_handler.c b/src/frontend/signal_handler.c index 51fe9fdf8..f4e5953bd 100644 --- a/src/frontend/signal_handler.c +++ b/src/frontend/signal_handler.c @@ -18,7 +18,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include "signal_handler.h" #include "plotting/graf.h" -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI void winmessage(char* new_msg); #endif @@ -144,7 +144,7 @@ RETSIGTYPE sigsegv(void) { fprintf(cp_err, "\ninternal error -- segmentation violation\n"); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI winmessage("Fatal error in NGSPICE"); #endif fatal(); diff --git a/src/frontend/spec.c b/src/frontend/spec.c index ecc6a9be7..82d073706 100644 --- a/src/frontend/spec.c +++ b/src/frontend/spec.c @@ -264,7 +264,7 @@ com_spec(wordlist *wl) fdvec[i][j].cx_imag += value*sina; } } -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI SetAnalyse("spec", (int)(j * 1000./ fpts)); #endif } diff --git a/src/frontend/spec.h b/src/frontend/spec.h index a3dcd9211..2b05faa45 100644 --- a/src/frontend/spec.h +++ b/src/frontend/spec.h @@ -6,7 +6,7 @@ #ifndef ngspice_SPEC_H #define ngspice_SPEC_H -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI extern void SetAnalyse(char *Analyse, int Percent); #endif diff --git a/src/frontend/wdisp/windisp.c b/src/frontend/wdisp/windisp.c index d4a693145..c4abeed79 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -7,7 +7,7 @@ #include "ngspice/ngspice.h" -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #include "ngspice/graph.h" #include "ngspice/ftedev.h" @@ -942,4 +942,4 @@ static void WIN_ScreentoData(GRAPH *graph, int x, int y, double *fx, double *fy) } -#endif /* HAS_WINDOWS */ +#endif /* HAS_WINGUI */ diff --git a/src/frontend/wdisp/winprint.c b/src/frontend/wdisp/winprint.c index 60da9cabe..9a9d5ea9d 100644 --- a/src/frontend/wdisp/winprint.c +++ b/src/frontend/wdisp/winprint.c @@ -6,7 +6,7 @@ #include "ngspice/ngspice.h" -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #include "ngspice/graph.h" #include "ngspice/ftedev.h" @@ -473,5 +473,5 @@ int WPRINT_DiagramReady(void) return 0; } -#endif /* HAS_WINDOWS */ +#endif /* HAS_WINGUI */ diff --git a/src/include/ngspice/ngspice.h b/src/include/ngspice/ngspice.h index 6bce19347..4d242a9f4 100644 --- a/src/include/ngspice/ngspice.h +++ b/src/include/ngspice/ngspice.h @@ -137,7 +137,7 @@ #include #endif -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #include "ngspice/wstdio.h" #endif diff --git a/src/main.c b/src/main.c index 4e56249d7..d9bf24fb8 100644 --- a/src/main.c +++ b/src/main.c @@ -44,7 +44,7 @@ #include "misc/ivars.h" #include "misc/misc_time.h" -#if defined(HAS_WINDOWS) || defined(_MSC_VER) || defined(__MINGW32__) +#if defined(HAS_WINGUI) || defined(_MSC_VER) || defined(__MINGW32__) # include "misc/mktemp.h" #endif @@ -95,7 +95,7 @@ bool ft_intrpt = FALSE; /* Set by the (void) signal handlers. TRUE = we've b bool ft_setflag = FALSE; /* TRUE = Don't abort simulation after an interrupt. */ char *ft_rawfile = "rawspice.raw"; -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI extern void winmessage(char *new_msg); /* display a message box (defined in winmain.c)*/ extern void SetSource( char *Name); /* display the source file name in the source window */ extern int xmain(int argc, char **argv); @@ -490,7 +490,7 @@ static void sp_shutdown(int exitval) { destroy_ivars(); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI if (exitval == EXIT_BAD) winmessage("Fatal error in SPICE"); else if (exitval == EXIT_INFO) @@ -784,7 +784,7 @@ print_news(void) } -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #define main xmain #endif @@ -837,7 +837,7 @@ main(int argc, char **argv) circuit_file = stdin; -#if defined(HAVE_ISATTY) && !defined(HAS_WINDOWS) +#if defined(HAVE_ISATTY) && !defined(HAS_WINGUI) istty = (bool) isatty(fileno(stdin)); #endif @@ -989,7 +989,7 @@ main(int argc, char **argv) fprintf(stdout, "Comments and warnings go to log-file: %s\n\n", log_file); /* Open the log file */ -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI /* flogp used by winmain's putc which writes to file 'log_file' */ flogp = fopen(log_file, "w"); if (!flogp) { @@ -1055,7 +1055,7 @@ main(int argc, char **argv) #ifdef SIGBUS signal(SIGBUS, (SIGNAL_FUNCTION) sigbus); #endif -#if defined(SIGSEGV) && !defined(NGDEBUG) && defined(HAS_WINDOWS) +#if defined(SIGSEGV) && !defined(NGDEBUG) && defined(HAS_WINGUI) /* Allow a comment and graceful shutdown after seg fault */ signal(SIGSEGV, (SIGNAL_FUNCTION) sigsegv); #endif @@ -1152,7 +1152,7 @@ main(int argc, char **argv) FILE *tempfile = tmpfile(); -#if defined(HAS_WINDOWS) || defined(_MSC_VER) || defined(__MINGW32__) +#if defined(HAS_WINGUI) || defined(_MSC_VER) || defined(__MINGW32__) char *dname = NULL; /* input file*/ char *tpf = NULL; /* temporary file */ @@ -1201,12 +1201,12 @@ main(int argc, char **argv) } } -#if defined(HAS_WINDOWS) || defined(_MSC_VER) || defined(__MINGW32__) +#if defined(HAS_WINGUI) || defined(_MSC_VER) || defined(__MINGW32__) /* Copy the input file name which otherwise will be lost due to the temporary file */ dname = copy(arg); #endif -#if defined(HAS_WINDOWS) +#if defined(HAS_WINGUI) /* write source file name into source window */ SetSource(dname); /* write source file name into a variable */ @@ -1220,7 +1220,7 @@ main(int argc, char **argv) fseek(tempfile, 0L, SEEK_SET); if (tempfile && (!err || !ft_batchmode)) { -#if defined(HAS_WINDOWS) || defined(_MSC_VER) || defined(__MINGW32__) +#if defined(HAS_WINGUI) || defined(_MSC_VER) || defined(__MINGW32__) /* Copy the input file name for adding another file search path */ inp_spsource(tempfile, FALSE, dname, FALSE); tfree(dname); diff --git a/src/maths/cmaths/cmath1.c b/src/maths/cmaths/cmath1.c index 4139492ea..50be9fbd6 100644 --- a/src/maths/cmaths/cmath1.c +++ b/src/maths/cmaths/cmath1.c @@ -24,7 +24,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include "cmath.h" #include "cmath1.h" -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #define fp_r_i_n_t_f fprintf #endif diff --git a/src/maths/sparse/spoutput.c b/src/maths/sparse/spoutput.c index 6746ed59a..6464e4fa0 100644 --- a/src/maths/sparse/spoutput.c +++ b/src/maths/sparse/spoutput.c @@ -56,7 +56,7 @@ int Printer_Width = PRINTER_WIDTH; #include "ngspice/config.h" -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #include "ngspice/wstdio.h" #endif diff --git a/src/misc/alloc.c b/src/misc/alloc.c index 7c76dd995..425c7fe9f 100644 --- a/src/misc/alloc.c +++ b/src/misc/alloc.c @@ -9,7 +9,7 @@ Copyright 1990 Regents of the University of California. All rights reserved. /* We need this because some tests in cmaths and some executables other than ngspice and ngnutmeg under LINUX don't know about controlled_exit */ -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI extern void controlled_exit(int status); #endif @@ -48,7 +48,7 @@ tmalloc(size_t num) #endif if (!s){ fprintf(stderr,"malloc: Internal Error: can't allocate %ld bytes. \n",(long)num); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI controlled_exit(EXIT_FAILURE); #else exit(EXIT_FAILURE); @@ -88,7 +88,7 @@ trealloc(void *ptr, size_t num) } if (!s) { fprintf(stderr,"realloc: Internal Error: can't allocate %ld bytes.\n", (long)num); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI controlled_exit(EXIT_FAILURE); #else exit(EXIT_FAILURE); diff --git a/src/misc/ivars.c b/src/misc/ivars.c index 3cdf9b382..43cfc26d9 100644 --- a/src/misc/ivars.c +++ b/src/misc/ivars.c @@ -79,7 +79,7 @@ ivars(char *argv0) mkvar(&Spice_Path, Spice_Exec_Dir, "ngspice", "SPICE_PATH"); /* may be used to store input files (*.lib, *.include, ...) */ /* get directory where ngspice resides */ -#if defined (HAS_WINDOWS) || defined (__MINGW32__) || defined (_MSC_VER) +#if defined (HAS_WINGUI) || defined (__MINGW32__) || defined (_MSC_VER) { char *ngpath = ngdirname(argv0); /* set path either to /input or, diff --git a/src/misc/util.c b/src/misc/util.c index 917d38863..36bfc6c68 100644 --- a/src/misc/util.c +++ b/src/misc/util.c @@ -188,7 +188,7 @@ basename(const char *name) */ -#if defined(HAS_WINDOWS) || defined(_MSC_VER) || defined(__MINGW32__) +#if defined(HAS_WINGUI) || defined(_MSC_VER) || defined(__MINGW32__) char * ngdirname(const char *name) diff --git a/src/nghelp.c b/src/nghelp.c index 70abe4835..6d63007f1 100644 --- a/src/nghelp.c +++ b/src/nghelp.c @@ -28,16 +28,16 @@ char *hlp_filelist[] = { "ngspice", 0 }; extern void ivars(char*); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI FILE *flogp; /* hvogt 15.12.2001 */ -#endif /* HAS_WINDOWS */ +#endif /* HAS_WINGUI */ int -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI xmain(int ac, char **av) #else main(int ac, char **av) -#endif /* HAS_WINDOWS */ +#endif /* HAS_WINGUI */ { wordlist *wl = NULL; @@ -83,11 +83,11 @@ out: } #endif /* X_DISPLAY_MISSING */ -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI /* Keep window open untill a key is pressed */ printf("Press a key to quit\n"); while( getchar() == EOF) {} -#endif /* HAS_WINDOWS */ +#endif /* HAS_WINGUI */ return EXIT_NORMAL; } diff --git a/src/spicelib/analysis/acan.c b/src/spicelib/analysis/acan.c index b8fc9ed42..bf74f9d7f 100644 --- a/src/spicelib/analysis/acan.c +++ b/src/spicelib/analysis/acan.c @@ -18,7 +18,7 @@ Modified 2001: AlansFixes /* gtri - end - wbk */ #endif -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI void SetAnalyse( char * Analyse, int Percent); #endif @@ -345,7 +345,7 @@ ACan(CKTcircuit *ckt, int restart) case OCTAVE: /* inserted again 14.12.2001 */ -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI { double endfreq = job->ACstopFreq; double startfreq = job->ACstartFreq; @@ -364,7 +364,7 @@ ACan(CKTcircuit *ckt, int restart) break; case LINEAR: -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI { double endfreq = job->ACstopFreq; double startfreq = job->ACstartFreq; diff --git a/src/spicelib/analysis/cktop.c b/src/spicelib/analysis/cktop.c index 9ce2f7364..4c51c7c1a 100644 --- a/src/spicelib/analysis/cktop.c +++ b/src/spicelib/analysis/cktop.c @@ -16,7 +16,7 @@ static int spice3_gmin (CKTcircuit *, long int, long int, int); static int gillespie_src (CKTcircuit *, long int, long int, int); static int spice3_src (CKTcircuit *, long int, long int, int); -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI void SetAnalyse( char * Analyse, int Percent); #endif @@ -25,7 +25,7 @@ CKTop (CKTcircuit * ckt, long int firstmode, long int continuemode, int iterlim) { int converged; -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI SetAnalyse("op", 0); #endif ckt->CKTmode = firstmode; diff --git a/src/spicelib/analysis/cktsetup.c b/src/spicelib/analysis/cktsetup.c index ec47307cc..00b402e6a 100644 --- a/src/spicelib/analysis/cktsetup.c +++ b/src/spicelib/analysis/cktsetup.c @@ -26,7 +26,7 @@ int nthreads; return(E_NOMEM);\ } -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI extern void SetAnalyse( char * Analyse, int Percent); #endif @@ -72,7 +72,7 @@ CKTsetup(CKTcircuit *ckt) #endif for (i=0;iDEVsetup && ckt->CKThead[i] ) { diff --git a/src/spicelib/analysis/dcpss.c b/src/spicelib/analysis/dcpss.c index df6138222..535ee23ef 100644 --- a/src/spicelib/analysis/dcpss.c +++ b/src/spicelib/analysis/dcpss.c @@ -27,7 +27,7 @@ #include "ngspice/cluster.h" #endif -#ifdef HAS_WINDOWS /* hvogt 10.03.99, nach W. Mues */ +#ifdef HAS_WINGUI /* hvogt 10.03.99, nach W. Mues */ void SetAnalyse(char * Analyse, int Percent); #endif @@ -1151,7 +1151,7 @@ resume: } } #endif -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI if (ckt->CKTtime == 0.) SetAnalyse( "tran init", 0); else if ((pss_state != PSS) && (shooting_cycle_counter > 0)) diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index 2c94cac59..cd363eeb0 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -34,7 +34,7 @@ extern struct dbcomm *dbs; #include "ngspice/cluster.h" #endif -#ifdef HAS_WINDOWS /* hvogt 10.03.99, nach W. Mues */ +#ifdef HAS_WINGUI /* hvogt 10.03.99, nach W. Mues */ void SetAnalyse(char * Analyse, int Percent); #endif @@ -508,7 +508,7 @@ resume: } } #endif -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI if (ckt->CKTtime == 0.) SetAnalyse( "tran init", 0); else diff --git a/src/spicelib/analysis/dctrcurv.c b/src/spicelib/analysis/dctrcurv.c index 7e0a218e6..65f5e5f64 100644 --- a/src/spicelib/analysis/dctrcurv.c +++ b/src/spicelib/analysis/dctrcurv.c @@ -24,7 +24,7 @@ Modified: 1999 Paolo Nenzi #include "ngspice/devdefs.h" -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI void SetAnalyse( char * Analyse, int Percent); static double actval, actdiff; #endif @@ -167,7 +167,7 @@ DCtrCurv(CKTcircuit *ckt, int restart) found:; } -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI actval = job->TRCVvStart[job->TRCVnestLevel]; actdiff = job->TRCVvStart[job->TRCVnestLevel] - job->TRCVvStop[job->TRCVnestLevel]; #endif @@ -519,7 +519,7 @@ nextstep:; job->TRCVnestState = i; return(E_PAUSE); } -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI if (i == job->TRCVnestLevel) { actval += job->TRCVvStep[job->TRCVnestLevel]; SetAnalyse( "dc", abs((int)(actval * 1000. / actdiff))); diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index 60dd437cf..0d1c2d46b 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -40,13 +40,13 @@ #ifdef XSPICE /*saj headers for xspice*/ #include /* for strcpy, strcat*/ -#if (!defined HAS_WINDOWS) && (!defined __MINGW32__) && (!defined _MSC_VER) +#if (!defined HAS_WINGUI) && (!defined __MINGW32__) && (!defined _MSC_VER) #include /* to load libraries*/ typedef void * funptr_t; -#else /* ifdef HAS_WINDOWS */ +#else /* ifdef HAS_WINGUI */ #undef BOOLEAN #include -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #include "ngspice/wstdio.h" #endif typedef FARPROC funptr_t; @@ -58,7 +58,7 @@ char *dlerror (void); #define RTLD_NOW 2 /* immediate function call binding */ #define RTLD_GLOBAL 4 /* symbols in this dlopen'ed obj are visible to other dlopen'ed objs */ static char errstr[128]; -#endif /* ifndef HAS_WINDOWS */ +#endif /* ifndef HAS_WINGUI */ #include "ngspice/dllitf.h" /* the coreInfo Structure*/ #include "ngspice/evtudn.h" /*Use defined nodes */ @@ -486,7 +486,7 @@ int load_opus(char *name){ return 0; } -#if defined(__MINGW32__) || defined(HAS_WINDOWS) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(HAS_WINGUI) || defined(_MSC_VER) void *dlopen(const char *name,int type) { diff --git a/src/spicelib/parser/inppas2.c b/src/spicelib/parser/inppas2.c index 69cd2082a..1f2d89838 100644 --- a/src/spicelib/parser/inppas2.c +++ b/src/spicelib/parser/inppas2.c @@ -16,7 +16,7 @@ Author: 1985 Thomas L. Quarles /* gtri - end - wbk - 11/9/90 */ #endif -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI extern void SetAnalyse( char * Analyse, int Percent); #endif @@ -35,7 +35,7 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task) char *gname; CKTnode *gnode; int error; /* used by the macros defined above */ -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI int linecount = 0, actcount = 0; #endif @@ -71,7 +71,7 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task) #endif -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI for (current = data; current != NULL; current = current->nextcard) linecount++; #endif @@ -83,7 +83,7 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task) printf("In INPpas2, examining card %s . . .\n", current->line); #endif -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI if (linecount > 0) { SetAnalyse( "Circuit2", (int) (1000.*actcount/linecount)); actcount++; diff --git a/src/winmain.c b/src/winmain.c index 77aa686c8..cf36fdbf8 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -5,7 +5,7 @@ Stand: 17.10.2009 */ #include "ngspice/config.h" -#ifdef HAS_WINDOWS +#ifdef HAS_WINGUI #define STRICT // strict type checking #define WIN32_LEAN_AND_MEAN @@ -1415,5 +1415,5 @@ void winmessage(char* new_msg) MessageBox(NULL, new_msg, "Ngspice Info", MB_OK|MB_ICONERROR); } -#endif /* HAS_WINDOWS */ +#endif /* HAS_WINGUI */ diff --git a/visualc/include/ngspice/config.h b/visualc/include/ngspice/config.h index 17c910db9..346d478fe 100644 --- a/visualc/include/ngspice/config.h +++ b/visualc/include/ngspice/config.h @@ -49,7 +49,7 @@ /* CONSOLE flag set in configurations console_debug and console_release */ #ifndef CONSOLE /* define to specify MS Windows GUI executable */ -#define HAS_WINDOWS 1 +#define HAS_WINGUI 1 #endif /* Define to 1 if you have the `access' function. */