Browse Source

updates tcl for Windows

h_vogt 14 years ago
parent
commit
5d101f46f9
  1. 6
      ChangeLog
  2. 2
      src/frontend/outitf.c
  3. 18
      src/frontend/vectors.c
  4. 3
      src/include/ngspice/ngspice.h
  5. 4
      src/misc/alloc.c
  6. 5
      src/tclspice.c

6
ChangeLog

@ -1,3 +1,9 @@
2012-02-11 Holger Vogt
* ngspice.h: fprintf --> tcl_fprintf added
* tclspice.c: small updates for Windows
* outitf.c, vectors.c, alloc.c:
outheap (under Windows) provided, but deactivated
2012-02-11 Robert Larice
* src/spicelib/parser/inpptree-parser.c ,
* src/spicelib/parser/inpptree-parser.h :

2
src/frontend/outitf.c

@ -68,7 +68,7 @@ static void freeRun(runDesc *run);
to prevent massive memory fragmentation of standard process heap.
This is especially required by TCL for Windows, but may help
also under standard Windows GUI. */
#if (defined(HAS_TCLWIN)) && ((defined(_MSC_VER) || defined(__MINGW32__)))
#if 0 && (defined(HAS_TCLWIN)) && ((defined(_MSC_VER) || defined(__MINGW32__)))
#define newrealloc hrealloc
#else
#define newrealloc trealloc

18
src/frontend/vectors.c

@ -22,6 +22,14 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "plotting/plotting.h"
#include "error.h" /* controlled_exit() */
#if 0 && defined(HAS_TCLWIN)
#if defined(_MSC_VER) || defined(__MINGW32__)
#undef BOOLEAN
#include <windows.h>
extern HANDLE outheap;
#endif
#endif
#ifdef XSPICE
/* gtri - begin - add function prototype for EVTfindvec */
struct dvec *EVTfindvec(char *node);
@ -813,7 +821,17 @@ vec_free_x(struct dvec *v)
}
}
if (v->v_name) tfree(v->v_name);
#if 0 && (defined(HAS_TCLWIN)) && ((defined(_MSC_VER) || defined(__MINGW32__)))
if (v->v_realdata) {
if (HeapValidate(outheap, 0, v->v_realdata))
HeapFree(outheap, 0, v->v_realdata);
else
tfree(v->v_realdata);
}
#else
if (v->v_realdata) tfree(v->v_realdata);
#endif
if (v->v_compdata) tfree(v->v_compdata);
tfree(v);
return;

3
src/include/ngspice/ngspice.h

@ -247,6 +247,9 @@ extern int tcl_fprintf(FILE *f, const char *format, ...);
#undef printf
#define printf tcl_printf
#undef fprintf
#define fprintf tcl_fprintf
#undef perror
#define perror(string) fprintf(stderr,"%s: %s\n",string,sys_errlist[errno])

4
src/misc/alloc.c

@ -14,7 +14,7 @@ Copyright 1990 Regents of the University of California. All rights reserved.
#include <tcl.h>
#endif
#if defined(HAS_WINDOWS) || defined(HAS_TCLWIN)
#if defined(HAS_WINDOWS) || (defined(HAS_TCLWIN) && 0)
#if defined(_MSC_VER) || defined(__MINGW32__)
#undef BOOLEAN
#include <windows.h>
@ -142,7 +142,7 @@ trealloc(void *ptr, size_t num)
Function is used in outitf.c to prevent heap fragmentation
An additional heap outheap is used to store the plot output data.
*/
#if defined(HAS_TCLWIN)
#if 0 && defined(HAS_TCLWIN)
#if defined(_MSC_VER) || defined(__MINGW32__)
void *
hrealloc(void *ptr, size_t num)

5
src/tclspice.c

@ -187,6 +187,9 @@ HANDLE outheap;
void tcl_stdflush(FILE *f);
int tcl_vfprintf(FILE *f, const char *fmt, va_list args);
#if defined(__MINGW32__) || defined(_MSC_VER)
__declspec(dllexport)
#endif
int Spice_Init(Tcl_Interp *interp);
int Tcl_ExecutePerLoop(void);
void triggerEventCheck(ClientData clientData,int flags);
@ -2241,7 +2244,7 @@ int Spice_Init(Tcl_Interp *interp) {
save_interp();
#if defined(_MSC_VER) || defined(__MINGW32__)
#if 0 && (defined(_MSC_VER) || defined(__MINGW32__))
/* create private heap for current process*/
outheap = HeapCreate(0, 10000000, 0);
if (!outheap) {

Loading…
Cancel
Save