summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn van Groningen2008-04-10 10:50:22 +0000
committerJohn van Groningen2008-04-10 10:50:22 +0000
commitaadc7382adf50aaaa3e3ad002eb775c0fb9a6e99 (patch)
tree0a4f807d21d3bcf2bdbbc71eeefe4149c2dcb7ee
parentexport clean_init and clean_fini for initializing and finalizing (diff)
fix printing of 64 bit integers (use all 64 bits, instead of only 32)
-rw-r--r--scon.c12
-rw-r--r--scon.h8
-rw-r--r--ufileIO2.c10
3 files changed, 29 insertions, 1 deletions
diff --git a/scon.c b/scon.c
index 8250e49..f0a24dd 100644
--- a/scon.c
+++ b/scon.c
@@ -638,6 +638,17 @@ void ew_print_string (char *s)
fputs (s,stderr);
}
+#ifdef A64
+void w_print_int (long n)
+{
+ printf ("%ld",n);
+}
+
+void ew_print_int (long n)
+{
+ fprintf (stderr,"%ld",n);
+}
+#else
void w_print_int (int n)
{
printf ("%d",n);
@@ -647,6 +658,7 @@ void ew_print_int (int n)
{
fprintf (stderr,"%d",n);
}
+#endif
void w_print_real (double r)
{
diff --git a/scon.h b/scon.h
index 570ab32..eadb68b 100644
--- a/scon.h
+++ b/scon.h
@@ -3,12 +3,20 @@ extern int w_get_int (int *i_p);
extern int w_get_real (double *r_p);
extern unsigned long w_get_text (char *string,unsigned long max_length);
extern void w_print_char (char c);
+#ifdef A64
+extern void w_print_int (long i);
+#else
extern void w_print_int (int i);
+#endif
extern void w_print_real (double r);
extern void w_print_string (char *s);
extern void w_print_text (char *s,unsigned long length);
extern void ew_print_char (char c);
+#ifdef A64
+extern void ew_print_int (long i);
+#else
extern void ew_print_int (int i);
+#endif
extern void ew_print_real (double r);
extern void ew_print_string (char *s);
extern void ew_print_text (char *s,unsigned long length);
diff --git a/ufileIO2.c b/ufileIO2.c
index 2aadfed..bd4b351 100644
--- a/ufileIO2.c
+++ b/ufileIO2.c
@@ -15,6 +15,10 @@
# include <string.h>
#endif
+#ifdef __x86_64__
+# define A64
+#endif
+
#include "scon.h"
extern void IO_error (char*);
@@ -807,8 +811,12 @@ void file_write_char (int c,long fn)
}
}
+#ifdef A64
+void file_write_int (long i,long fn)
+#else
void file_write_int (int i,long fn)
-{
+#endif
+{
if (fn<FIRST_REAL_FILE){
switch (fn){
case 0: