Number: 161
Title: build problem on OpenBSD because strtoll does not exist
Submitter: Alexander Bluhm
Date: Thu Jun 20 17:10:18 2002
Subsys: Build/Installation
Version: 1.8.5
System: x86-Other-OpenBSD 2.9
Severity: minor
Problem:
tools/gpr fails to link because in tools/expr/exeval.c and tools/expr/exgram.h strtoll is used. Although configure checks for it, the HAVE_STRTOLL define is not evaluated. I have not tested my patch, I have just copied the #ifdef from somewhere above in the same file to the buggy location. strtoll is simply replaced by strtol.
Fix:

diff -ru graphviz-1.8.5.orig/tools/expr/exeval.c graphviz-1.8.5/tools/expr/exeval.c
--- graphviz-1.8.5.orig/tools/expr/exeval.c     Mon Apr  8 01:50:15 2002
+++ graphviz-1.8.5/tools/expr/exeval.c  Thu Jun 20 22:40:12 2002
@@ -1159,7 +1159,11 @@
                        tmp.data.constant.value = v;
                        if ((*ex->disc->convertf)(ex, &tmp, INTEGER, expr->data.operand.right ? expr->data.operand.right->data.variable.symbol : (Exid_t*)0, 0, ex->disc))
                        {
+#ifdef HAVE_STRTOLL
                                tmp.data.constant.value.integer = strtoll(v.string, &e, 0);
+#else
+                               tmp.data.constant.value.integer = strtol(v.string, &e, 0);
+#endif
                                if (*e)
                                        tmp.data.constant.value.integer = *v.string != 0;
                        }
diff -ru graphviz-1.8.5.orig/tools/expr/exgram.h graphviz-1.8.5/tools/expr/exgram.h
--- graphviz-1.8.5.orig/tools/expr/exgram.h     Mon Jan 28 19:12:25 2002
+++ graphviz-1.8.5/tools/expr/exgram.h  Thu Jun 20 22:42:27 2002
@@ -253,7 +253,11 @@
                        break;
                case S2I:
                        s = x->data.constant.value.string;
+#ifdef HAVE_STRTOLL
                        x->data.constant.value.integer = strtoll(s, &e, 0);
+#else
+                       x->data.constant.value.integer = strtol(s, &e, 0);
+#endif

Owner: ellson
Status: Fixed (14 April 2002)