From 73e581f01522e86e7c7b1b66445bd6fa32ccd37f Mon Sep 17 00:00:00 2001 From: h_vogt Date: Tue, 23 Sep 2008 22:10:56 +0000 Subject: [PATCH] VC++ 2008 compatibility --- ChangeLog | 5 +++++ src/include/wstdio.h | 8 +++++++- src/maths/misc/scalb.c | 9 ++++++++- xgraph/.cvsignore | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e31f39932..55a66973c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-24 Holger Vogt + * wstdio.h, scalb.c, complex.h + Small changes to allow compilation with MS Visual C++ 2008 + main.c, util.c: path of *.cir input file as search path for .include files (Windows only) + 2008-09-22 Holger Vogt * complex.h, measure.c, resource.c, windisp.c, xpressn.c, rawfile.c, runcoms.c, readhelp.c, defines.h, ngspice.h, b4soild.c, hsm1eval102.c, hsm1eval112.c, hsm1eval120.c, wstdio.h diff --git a/src/include/wstdio.h b/src/include/wstdio.h index cb9c5738a..cfa1cef05 100644 --- a/src/include/wstdio.h +++ b/src/include/wstdio.h @@ -43,8 +43,11 @@ int vfp_r_i_n_t_f(FILE * __stream, const char * __format, void * __arglist); /*int vfs_c_a_n_f(FILE * __stream, const char * __format, void * __arglist);*/ int vp_r_i_n_t_f(const char * __format, void * __arglist); /*int vs_c_a_n_f(const char * __format, void * __arglist); */ -#ifdef _MSC_VER +#ifdef _MSC_VER +/* VC++ 2008 */ _CRTIMP int __cdecl read(int fd, _Out_bytecap_(_MaxCharCount) void * __buf, _In_ unsigned int __n); +/* VC++ 2005 */ +//_CRTIMP int __cdecl read(int fd, void * __buf, unsigned int __n); #else int r_e_a_d(int fd, char * __buf, int __n); #endif @@ -100,6 +103,9 @@ int fp_u_t_char(int __c); #define fileno _fileno #define getcwd _getcwd #define isnan _isnan + +#define scalb _scalb + #endif /*----------------------------------------------------------------------------*/ diff --git a/src/maths/misc/scalb.c b/src/maths/misc/scalb.c index 18c127654..bd29ab1ee 100644 --- a/src/maths/misc/scalb.c +++ b/src/maths/misc/scalb.c @@ -7,7 +7,7 @@ Copyright 1991 Regents of the University of California. All rights reserved. #ifndef HAVE_SCALB # ifdef HAVE_SCALBN # define scalb scalbn -#else /* Chris Inbody */ +# else /* Chris Inbody */ double scalb(double x, int n) @@ -30,5 +30,12 @@ scalb(double x, int n) } # endif /* HAVE_SCALBN */ #else /* HAVE_SCALB */ +# ifndef HAVE_SCALBN +extern scalb(double x, long n); +scalbn(double x, int n) +{ + return scalb(x, (long)n); +} +# endif int Dummy_Symbol_1; #endif /* HAVE_SCALB */ diff --git a/xgraph/.cvsignore b/xgraph/.cvsignore index ce6aa0cef..bb5c9de8b 100644 --- a/xgraph/.cvsignore +++ b/xgraph/.cvsignore @@ -1,4 +1,5 @@ Makefile +Makefile.in .deps autoconf.h *.cache