Browse Source

Small changes to allow compilation with MS Visual C++ 2008

pre-master-46
h_vogt 18 years ago
parent
commit
4b055a4ca8
  1. 5
      ChangeLog
  2. 4
      src/frontend/help/readhelp.c
  3. 2
      src/frontend/measure.c
  4. 2
      src/frontend/numparam/xpressn.c
  5. 6
      src/frontend/rawfile.c
  6. 5
      src/frontend/resource.c
  7. 2
      src/frontend/runcoms.c
  8. 3
      src/frontend/wdisp/windisp.c
  9. 4
      src/include/complex.h
  10. 2
      src/include/defines.h
  11. 6
      src/include/ngspice.h
  12. 12
      src/include/wstdio.h
  13. 4
      src/spicelib/devices/bsim3soi/b4soild.c
  14. 4
      src/spicelib/devices/hisim/hsm1eval102.c
  15. 3
      src/spicelib/devices/hisim/hsm1eval112.c
  16. 3
      src/spicelib/devices/hisim/hsm1eval120.c

5
ChangeLog

@ -1,3 +1,8 @@
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
Small changes to allow compilation with MS Visual C++ 2008
2008-09-15 Lionel Sainte Cluque
* src/Makefile.am: Add $(DESTDIR) in tclspice installation, required by debian package.
* src/Makefile.am: Use -no-undefined only for windows build (libspice_la_LDFLAGS)

4
src/frontend/help/readhelp.c

@ -17,6 +17,10 @@ Modified 1999 Emmanuel Rouat
#include "hlpdefs.h"
#include "suffix.h"
#if defined (_MSC_VER)
#define strncasecmp _strnicmp
#endif
static char *getsubject(fplace *place);
static toplink *getsubtoplink(char **ss);

2
src/frontend/measure.c

@ -13,6 +13,7 @@ static bool measure_valid[20000];
static bool just_chk_meas;
static bool measures_passed;
#if !defined(_MSC_VER)
static double
max( double a, double b ) {
if ( a > b ) return a;
@ -24,6 +25,7 @@ min( double a, double b ) {
if ( a < b ) return a;
else return b;
}
#endif
static int
get_measure_precision()

2
src/frontend/numparam/xpressn.c

@ -15,6 +15,7 @@
static Str (150, keys); /* all my keywords */
static Str (150, fmath); /* all math functions */
#ifndef _MSC_VER
static double
max (double x, double y)
{
@ -26,6 +27,7 @@ min (double x, double y)
{
return (x < y) ? x : y;
}
#endif
static double
ternary_fcn (int conditional, double if_value, double else_value)

6
src/frontend/rawfile.c

@ -63,7 +63,7 @@ raw_write(char *name, struct plot *pl, bool app, bool binary)
else
prec = DEFPREC;
#ifdef __MINGW32__
#if defined(__MINGW32__) || defined(_MSC_VER)
/* - Binary file binary write - hvogt 15.03.2000 ---------------------*/
if (binary) {
if (!(fp = fopen(name, app ? "ab" : "wb"))) {
@ -295,7 +295,7 @@ raw_read(char *name)
FILE *fp, *lastin, *lastout, *lasterr;
#ifdef __MINGW32__
#if defined(__MINGW32__) || defined(_MSC_VER)
bool binary = TRUE;
#endif
@ -304,7 +304,7 @@ raw_read(char *name)
return (NULL);
}
#ifdef __MINGW32__
#if defined(__MINGW32__) || defined(_MSC_VER)
/* Test, whether file really ASCII, otherwise assume binary hvogt 15.3.2000 */
while (fgets(buf, BSIZE_SP, fp)) {
if (ciprefix("values:", buf)) {

5
src/frontend/resource.c

@ -23,7 +23,12 @@ $Id$
#include "resource.h"
#include "variable.h"
#include "cktdefs.h"
#ifdef _MSC_VER
#include "../misc/misc_time.h" /* timediff */
#else
#include "src/misc/misc_time.h" /* timediff */
#endif
#ifdef XSPICE
/* gtri - add - 12/12/90 - wbk - include ipc stuff */

2
src/frontend/runcoms.c

@ -221,7 +221,7 @@ dosim(char *what, wordlist *wl)
#endif /* PARALLEL_ARCH */
if (!*wl->wl_word)
rawfileFp = stdout;
#ifdef __MINGW32__
#if defined(__MINGW32__) || defined(_MSC_VER)
/* ask if binary or ASCII, open file with w or wb hvogt 15.3.2000 */
else if (ascii) {
if(!(rawfileFp = fopen(wl->wl_word, "w"))) {

3
src/frontend/wdisp/windisp.c

@ -60,6 +60,9 @@ extern int NewViewport(GRAPH *pgraph);
/* defines */
#define RAD_TO_DEG (180.0 / M_PI)
#ifndef M_LN10
#define M_LN10 2.30258509299404568402
#endif
/* local variables */
static int IsRegistered = 0; /* 1 if window class is registered */

4
src/include/complex.h

@ -12,6 +12,10 @@ struct _complex1 { /* IBM portability... renamed due to double definition in M
double cx_imag;
} ;
#ifdef _MSC_VER
typedef struct _complex1 _complex;
#endif
typedef struct _complex1 complex;
#define realpart(cval) ((struct _complex1 *) (cval))->cx_real

2
src/include/defines.h

@ -74,7 +74,7 @@
/* Alternate initialisation file name */
#define ALT_INITSTR "spice.rc"
#ifdef __MINGW32__
#if defined(__MINGW32__) || defined(_MSC_VER)
#define DIR_PATHSEP "\\"
#define DIR_TERM '\\'
#define DIR_CWD "."

6
src/include/ngspice.h

@ -131,7 +131,7 @@ struct timeb timebegin;
#include "wstdio.h"
#endif
#if defined (__MINGW32__) || defined (__CYGWIN__)
#if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER)
#include <io.h>
#else
# ifdef HAVE_SYS_IO_H
@ -159,6 +159,10 @@ struct timeb timebegin;
#define HUGE HUGE_VAL
#endif
#if defined (_MSC_VER)
#define finite _finite
#endif
extern char *gettok(char **s);
extern char *gettok_noparens(char **s);
extern char *gettok_node(char **s);

12
src/include/wstdio.h

@ -43,7 +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
_CRTIMP int __cdecl read(int fd, _Out_bytecap_(_MaxCharCount) void * __buf, _In_ unsigned int __n);
#else
int r_e_a_d(int fd, char * __buf, int __n);
#endif
int g_e_t_c(FILE * __fp);
int g_e_t_char(void);
int p_u_t_char(const int __c);
@ -90,6 +94,14 @@ int fp_u_t_char(int __c);
#define fgetchar fg_e_t_char
#define fputchar fp_u_t_char
#if defined (_MSC_VER)
#define strdup _strdup
#define unlink _unlink
#define fileno _fileno
#define getcwd _getcwd
#define isnan _isnan
#endif
/*----------------------------------------------------------------------------*/
#endif /* WSTDIO_H */

4
src/spicelib/devices/bsim3soi/b4soild.c

@ -18,6 +18,10 @@
#include "devdefs.h"
#include "suffix.h"
#ifdef _MSC_VER
extern int _isnan(double);
#endif
#define EPSOX 3.453133e-11
#define EPSSI 1.03594e-10
#define Charge_q 1.60219e-19

4
src/spicelib/devices/hisim/hsm1eval102.c

@ -71,7 +71,9 @@
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
#ifdef _MSC_VER
#define finite _finite
#endif
/*-----------------------------------*
* HiSIM macros and structures.
* - All inputs and outputs are defined here.

3
src/spicelib/devices/hisim/hsm1eval112.c

@ -71,6 +71,9 @@
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
#ifdef _MSC_VER
#define finite _finite
#endif
/*-----------------------------------*
* HiSIM macros and structures.

3
src/spicelib/devices/hisim/hsm1eval120.c

@ -71,6 +71,9 @@
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
#ifdef _MSC_VER
#define finite _finite
#endif
/*-----------------------------------*
* HiSIM macros and structures.

Loading…
Cancel
Save