ref: 19feae6a37cc9322f84e5cebf1d339826fb97cb6
parent: d85eab9f640c6872faef17cfd2fc74a4d728ad77
author: cbagwell <cbagwell>
date: Sun Jul 20 23:11:15 EDT 2008
Don't redefine min/max.
--- a/lpc10/f2c.h
+++ b/lpc10/f2c.h
@@ -21,7 +21,7 @@
/** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
- - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
+ - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
#ifndef F2C_INCLUDE
#define F2C_INCLUDE
@@ -74,115 +74,119 @@
/*external read, write*/
typedef struct
-{ flag cierr;
- ftnint ciunit;
- flag ciend;
- char *cifmt;
- ftnint cirec;
+{ flag cierr;
+ ftnint ciunit;
+ flag ciend;
+ char *cifmt;
+ ftnint cirec;
} cilist;
/*internal read, write*/
typedef struct
-{ flag icierr;
- char *iciunit;
- flag iciend;
- char *icifmt;
- ftnint icirlen;
- ftnint icirnum;
+{ flag icierr;
+ char *iciunit;
+ flag iciend;
+ char *icifmt;
+ ftnint icirlen;
+ ftnint icirnum;
} icilist;
/*open*/
typedef struct
-{ flag oerr;
- ftnint ounit;
- char *ofnm;
- ftnlen ofnmlen;
- char *osta;
- char *oacc;
- char *ofm;
- ftnint orl;
- char *oblnk;
+{ flag oerr;
+ ftnint ounit;
+ char *ofnm;
+ ftnlen ofnmlen;
+ char *osta;
+ char *oacc;
+ char *ofm;
+ ftnint orl;
+ char *oblnk;
} olist;
/*close*/
typedef struct
-{ flag cerr;
- ftnint cunit;
- char *csta;
+{ flag cerr;
+ ftnint cunit;
+ char *csta;
} cllist;
/*rewind, backspace, endfile*/
typedef struct
-{ flag aerr;
- ftnint aunit;
+{ flag aerr;
+ ftnint aunit;
} alist;
/* inquire */
typedef struct
-{ flag inerr;
- ftnint inunit;
- char *infile;
- ftnlen infilen;
- ftnint *inex; /*parameters in standard's order*/
- ftnint *inopen;
- ftnint *innum;
- ftnint *innamed;
- char *inname;
- ftnlen innamlen;
- char *inacc;
- ftnlen inacclen;
- char *inseq;
- ftnlen inseqlen;
- char *indir;
- ftnlen indirlen;
- char *infmt;
- ftnlen infmtlen;
- char *inform;
- ftnint informlen;
- char *inunf;
- ftnlen inunflen;
- ftnint *inrecl;
- ftnint *innrec;
- char *inblank;
- ftnlen inblanklen;
+{ flag inerr;
+ ftnint inunit;
+ char *infile;
+ ftnlen infilen;
+ ftnint *inex; /*parameters in standard's order*/
+ ftnint *inopen;
+ ftnint *innum;
+ ftnint *innamed;
+ char *inname;
+ ftnlen innamlen;
+ char *inacc;
+ ftnlen inacclen;
+ char *inseq;
+ ftnlen inseqlen;
+ char *indir;
+ ftnlen indirlen;
+ char *infmt;
+ ftnlen infmtlen;
+ char *inform;
+ ftnint informlen;
+ char *inunf;
+ ftnlen inunflen;
+ ftnint *inrecl;
+ ftnint *innrec;
+ char *inblank;
+ ftnlen inblanklen;
} inlist;
#define VOID void
-union Multitype { /* for multiple entry points */
- integer1 g;
- shortint h;
- integer i;
- /* longint j; */
- real r;
- doublereal d;
- complex c;
- doublecomplex z;
- };
+union Multitype { /* for multiple entry points */
+ integer1 g;
+ shortint h;
+ integer i;
+ /* longint j; */
+ real r;
+ doublereal d;
+ complex c;
+ doublecomplex z;
+ };
typedef union Multitype Multitype;
-/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
+/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
-struct Vardesc { /* for Namelist */
- char *name;
- char *addr;
- ftnlen *dims;
- int type;
- };
+struct Vardesc { /* for Namelist */
+ char *name;
+ char *addr;
+ ftnlen *dims;
+ int type;
+ };
typedef struct Vardesc Vardesc;
struct Namelist {
- char *name;
- Vardesc **vars;
- int nvars;
- };
+ char *name;
+ Vardesc **vars;
+ int nvars;
+ };
typedef struct Namelist Namelist;
#define abs(x) ((x) >= 0 ? (x) : -(x))
#define dabs(x) (doublereal)abs(x)
+#ifndef min
#define min(a,b) ((a) <= (b) ? (a) : (b))
+#endif
+#ifndef max
#define max(a,b) ((a) >= (b) ? (a) : (b))
+#endif
#define dmin(a,b) (doublereal)min(a,b)
#define dmax(a,b) (doublereal)max(a,b)