Small changes to allow compilation with MS Visual C++ 2008
This commit is contained in:
parent
c2bb21e261
commit
4b055a4ca8
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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"))) {
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 "."
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@
|
|||
#ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#define finite _finite
|
||||
#endif
|
||||
|
||||
/*-----------------------------------*
|
||||
* HiSIM macros and structures.
|
||||
|
|
|
|||
|
|
@ -71,6 +71,9 @@
|
|||
#ifdef HAVE_IEEEFP_H
|
||||
# include <ieeefp.h>
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#define finite _finite
|
||||
#endif
|
||||
|
||||
/*-----------------------------------*
|
||||
* HiSIM macros and structures.
|
||||
|
|
|
|||
Loading…
Reference in New Issue