Cleaned up defintions of macro constants
This commit is contained in:
parent
be8bd7b40e
commit
4f79916a3e
|
|
@ -13,6 +13,10 @@
|
||||||
#ifndef ngspice_DEFINES_H
|
#ifndef ngspice_DEFINES_H
|
||||||
#define ngspice_DEFINES_H
|
#define ngspice_DEFINES_H
|
||||||
|
|
||||||
|
/* Floating point and integral limits */
|
||||||
|
#include <float.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Physical constants (const.h)
|
* Physical constants (const.h)
|
||||||
*/
|
*/
|
||||||
|
|
@ -20,6 +24,13 @@
|
||||||
* CONSTepsSi02, CONSTmuZero, REFTEMP */
|
* CONSTepsSi02, CONSTmuZero, REFTEMP */
|
||||||
#include "ngspice/const.h"
|
#include "ngspice/const.h"
|
||||||
|
|
||||||
|
/* These constants are defined by GCC in math.h, but they are not part of
|
||||||
|
* the ANSI C standard. The #ifndefs will prevent warnings regarding macro
|
||||||
|
* redefinitions if this file is included AFTER math.h. However, if the
|
||||||
|
* order is reversed, the warnings will occur. Thus, they introduce a header
|
||||||
|
* order dependency. A better solution would be to rename the macros to
|
||||||
|
* something like NGM_* (ngspice math) throughout the source code. Then there
|
||||||
|
* would be no header ordering dependency. */
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI CONSTpi
|
#define M_PI CONSTpi
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -37,60 +48,43 @@
|
||||||
* IEEE Floating point
|
* IEEE Floating point
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MAX_EXP_ARG 709.0
|
/* Largest exponent such that exp(MAX_EXP_ARG) <= DBL_MAX
|
||||||
|
* Actual max is ln(DBL_MAX) = 709.78. Unsure if there was any reason
|
||||||
#ifndef DBL_EPSILON
|
* for setting the value lower */
|
||||||
# define DBL_EPSILON 2.2204460492503131e-16
|
#define MAX_EXP_ARG 709.0
|
||||||
#endif
|
|
||||||
#ifndef DBL_MAX
|
|
||||||
# define DBL_MAX 1.79769313486231e+308
|
|
||||||
#endif
|
|
||||||
#ifndef DBL_MIN
|
|
||||||
# define DBL_MIN 2.22507385850721e-308
|
|
||||||
#endif
|
|
||||||
#ifndef SHRT_MAX
|
|
||||||
# define SHRT_MAX 32766
|
|
||||||
#endif
|
|
||||||
#ifndef INT_MAX
|
|
||||||
# define INT_MAX 2147483646
|
|
||||||
#endif
|
|
||||||
#ifndef LONG_MAX
|
|
||||||
# define LONG_MAX 2147483646
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAXPOSINT INT_MAX
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Standard initialisation file name */
|
/* Standard initialisation file name */
|
||||||
#define INITSTR ".spiceinit"
|
#define INITSTR ".spiceinit"
|
||||||
|
|
||||||
/* Alternate initialisation file name */
|
/* Alternate initialisation file name */
|
||||||
#define ALT_INITSTR "spice.rc"
|
#define ALT_INITSTR "spice.rc"
|
||||||
|
|
||||||
#if defined(__MINGW32__) || defined(_MSC_VER) || defined (HAS_WINGUI)
|
#if defined(__MINGW32__) || defined(_MSC_VER) || defined (HAS_WINGUI)
|
||||||
#define DIR_PATHSEP "\\"
|
#define DIR_PATHSEP "\\"
|
||||||
#define DIR_TERM '\\'
|
#define DIR_TERM '\\'
|
||||||
#define DIR_PATHSEP_LINUX "/"
|
#define DIR_PATHSEP_LINUX "/"
|
||||||
#define DIR_TERM_LINUX '/'
|
#define DIR_TERM_LINUX '/'
|
||||||
#define DIR_CWD "."
|
#define DIR_CWD "."
|
||||||
|
|
||||||
|
#define TEMPFORMAT "%s%d.tmp"
|
||||||
|
|
||||||
#define TEMPFORMAT "%s%d.tmp"
|
|
||||||
/*
|
/*
|
||||||
#define SYSTEM_PLOT5LPR "lpr -P%s -g %s"
|
#define SYSTEM_PLOT5LPR "lpr -P%s -g %s"
|
||||||
#define SYSTEM_PSLPR "lpr -P%s %s"
|
#define SYSTEM_PSLPR "lpr -P%s %s"
|
||||||
#define SYSTEM_MAIL "Mail -s \"%s (%s) Bug Report\" %s"
|
#define SYSTEM_MAIL "Mail -s \"%s (%s) Bug Report\" %s"
|
||||||
*/
|
*/
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define DIR_PATHSEP "/"
|
#define DIR_PATHSEP "/"
|
||||||
#define DIR_TERM '/'
|
#define DIR_TERM '/'
|
||||||
#define DIR_CWD "."
|
#define DIR_CWD "."
|
||||||
|
|
||||||
#define TEMPFORMAT "/tmp/%s%d"
|
#define TEMPFORMAT "/tmp/%s%d"
|
||||||
#define SYSTEM_PLOT5LPR "lpr -P%s -g %s"
|
#define SYSTEM_PLOT5LPR "lpr -P%s -g %s"
|
||||||
#define SYSTEM_PSLPR "lpr -P%s %s"
|
#define SYSTEM_PSLPR "lpr -P%s %s"
|
||||||
#define SYSTEM_MAIL "Mail -s \"%s (%s) Bug Report\" %s"
|
#define SYSTEM_MAIL "Mail -s \"%s (%s) Bug Report\" %s"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue