diff --git a/ChangeLog b/ChangeLog index e57a43a87..4db1eeb80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-07-17 Stefan Jones + + * configure.in src/xspice/xspice.c : + Fix compile problems with garbage collector + 2003-07-17 Steven Borley * src/frontend/resource.c src/frontend/parser/complete.c diff --git a/configure.in b/configure.in index b3881c9f1..3e4b6c469 100644 --- a/configure.in +++ b/configure.in @@ -292,9 +292,12 @@ AC_CHECK_HEADERS(float.h limits.h values.h) dnl Check for a few mathematical functions: AC_CHECK_FUNCS(erfc logb scalb scalbn asinh acosh atanh) +if test "$TCL_PACKAGE_PATH" = "" +then AC_MSG_RESULT(Checking for the presence of the Garbage Collector:) dnl Check for the garbage collector: AC_CHECK_LIB(gc,GC_malloc,AC_DEFINE(HAVE_LIBGC) LIBS="$LIBS -lgc") +fi dnl Check for the asprintf function: AC_CHECK_FUNCS(asprintf) diff --git a/src/xspice/xspice.c b/src/xspice/xspice.c index 4839e967d..3c89f0097 100755 --- a/src/xspice/xspice.c +++ b/src/xspice/xspice.c @@ -8,8 +8,9 @@ void *tcalloc(size_t a, size_t b){ return tmalloc(a*b); } -int MIFunsetup(GENmodel *model, CKTcircuit *ckt){ - return 0; + +static void *empty(void){ + return NULL; } struct coreInfo_t coreInfo = @@ -18,7 +19,7 @@ struct coreInfo_t coreInfo = MIFgetMod, MIFgetValue, MIFsetup, - MIFunsetup, + (int (*)(GENmodel *, CKTcircuit *))empty, MIFload, MIFmParam, MIFask, @@ -57,14 +58,24 @@ struct coreInfo_t coreInfo = cm_complex_subtract, cm_complex_multiply, cm_complex_divide, - NULL, - NULL, - NULL, + (FILE *(*)(void))empty, + (FILE *(*)(void))empty, + (FILE *(*)(void))empty, +#ifndef HAVE_LIBGC tmalloc, tcalloc, trealloc, txfree, - tmalloc, - trealloc, - txfree + (char *(*)(int))tmalloc, + (char *(*)(char *,int))trealloc, + (void (*)(char *))txfree +#else + GC_malloc, + tcalloc, + GC_realloc, + (void (*)(void *))empty, + (char *(*)(int))GC_malloc, + (char *(*)(char *,int))GC_realloc, + (void (*)(char *))empty +#endif };