| 1 |
Typedef signed and unsigned 64-bit integers for MSVC. |
| 2 |
Avoid the problematic prototypes for isatty() and ungetc(). |
| 3 |
Avoid redefinition of max(a,b) and min(a,b). |
| 4 |
|
| 5 |
diff -ur pmx-2.6.18.orig/libf2c/f2c.h pmx-2.6.18/libf2c/f2c.h |
| 6 |
--- pmx-2.6.18.orig/libf2c/f2c.h 2012-05-19 18:49:12.000000000 +0200 |
| 7 |
+++ pmx-2.6.18/libf2c/f2c.h 2012-07-11 17:17:59.000000000 +0200 |
| 8 |
@@ -23,8 +23,13 @@ |
| 9 |
typedef char logical1; |
| 10 |
typedef char integer1; |
| 11 |
#ifdef INTEGER_STAR_8 /* Adjust for integer*8. */ |
| 12 |
+#if defined(WIN32) && !defined(__MINGW32__) |
| 13 |
+typedef __int64 longint; /* system-dependent */ |
| 14 |
+typedef unsigned __int64 ulongint; /* system-dependent */ |
| 15 |
+#else |
| 16 |
typedef long long longint; /* system-dependent */ |
| 17 |
typedef unsigned long long ulongint; /* system-dependent */ |
| 18 |
+#endif |
| 19 |
#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b))) |
| 20 |
#define qbit_set(a,b) ((a) | ((ulongint)1 << (b))) |
| 21 |
#endif |
| 22 |
@@ -159,6 +164,8 @@ |
| 23 |
|
| 24 |
#define abs(x) ((x) >= 0 ? (x) : -(x)) |
| 25 |
#define dabs(x) (doublereal)abs(x) |
| 26 |
+#undef min |
| 27 |
+#undef max |
| 28 |
#define min(a,b) ((a) <= (b) ? (a) : (b)) |
| 29 |
#define max(a,b) ((a) >= (b) ? (a) : (b)) |
| 30 |
#define dmin(a,b) (doublereal)min(a,b) |
| 31 |
diff -ur pmx-2.6.18.orig/libf2c/fio.h pmx-2.6.18/libf2c/fio.h |
| 32 |
--- pmx-2.6.18.orig/libf2c/fio.h 2012-05-19 18:50:13.000000000 +0200 |
| 33 |
+++ pmx-2.6.18/libf2c/fio.h 2012-07-11 17:46:22.000000000 +0200 |
| 34 |
@@ -3,6 +3,9 @@ |
| 35 |
#endif |
| 36 |
#include <sys/types.h> /* for off_t */ |
| 37 |
#include "stdio.h" |
| 38 |
+#ifdef HAVE_UNISTD_H |
| 39 |
+#include <unistd.h> /* for isatty() */ |
| 40 |
+#endif |
| 41 |
#ifdef WIN32 |
| 42 |
extern int w32getc(FILE *f); |
| 43 |
#define getc w32getc |
| 44 |
@@ -113,7 +116,6 @@ |
| 45 |
extern int (*f__donewrec)(void), t_putc(int), x_wSL(void); |
| 46 |
extern void b_char(char*,char*,ftnlen), g_char(char*,ftnlen,char*); |
| 47 |
extern int c_sfe(cilist*), z_rnew(void); |
| 48 |
-extern int isatty(int); |
| 49 |
extern int err__fl(int,int,char*); |
| 50 |
extern int xrd_SL(void); |
| 51 |
extern int f__putbuf(int); |
| 52 |
diff -ur pmx-2.6.18.orig/libf2c/getenv_.c pmx-2.6.18/libf2c/getenv_.c |
| 53 |
--- pmx-2.6.18.orig/libf2c/getenv_.c 2012-04-09 18:24:12.000000000 +0200 |
| 54 |
+++ pmx-2.6.18/libf2c/getenv_.c 2012-07-12 13:28:57.000000000 +0200 |
| 55 |
@@ -1,8 +1,10 @@ |
| 56 |
#include "f2c.h" |
| 57 |
-#undef abs |
| 58 |
#ifdef KR_headers |
| 59 |
extern char *F77_aloc(), *getenv(); |
| 60 |
#else |
| 61 |
+#undef abs |
| 62 |
+#undef max |
| 63 |
+#undef min |
| 64 |
#include <stdlib.h> |
| 65 |
#include <string.h> |
| 66 |
#ifdef __cplusplus |
| 67 |
diff -ur pmx-2.6.18.orig/libf2c/lread.c pmx-2.6.18/libf2c/lread.c |
| 68 |
--- pmx-2.6.18.orig/libf2c/lread.c 2012-04-09 18:24:12.000000000 +0200 |
| 69 |
+++ pmx-2.6.18/libf2c/lread.c 2012-07-11 17:23:48.000000000 +0200 |
| 70 |
@@ -74,8 +74,6 @@ |
| 71 |
#define un_getc ungetc |
| 72 |
#ifdef KR_headers |
| 73 |
extern int ungetc(); |
| 74 |
-#else |
| 75 |
-extern int ungetc(int, FILE*); /* for systems with a buggy stdio.h */ |
| 76 |
#endif |
| 77 |
#endif |
| 78 |
|
| 79 |
diff -ur pmx-2.6.18.orig/libf2c/rsne.c pmx-2.6.18/libf2c/rsne.c |
| 80 |
--- pmx-2.6.18.orig/libf2c/rsne.c 2012-04-09 18:24:12.000000000 +0200 |
| 81 |
+++ pmx-2.6.18/libf2c/rsne.c 2012-07-11 17:23:51.000000000 +0200 |
| 82 |
@@ -66,7 +66,6 @@ |
| 83 |
{ return ungetc(x,f__cf); } |
| 84 |
#else |
| 85 |
#define un_getc ungetc |
| 86 |
-extern int ungetc(int, FILE*); /* for systems with a buggy stdio.h */ |
| 87 |
#endif |
| 88 |
#endif |