]> granicus.if.org Git - graphviz/commitdiff
Fix label library to use agerr.
authorEmden Gansner <erg@research.att.com>
Thu, 12 Jan 2012 20:52:51 +0000 (15:52 -0500)
committerEmden Gansner <erg@research.att.com>
Thu, 12 Jan 2012 20:52:51 +0000 (15:52 -0500)
lib/label/Makefile.am
lib/label/rectangle.c

index 3195fe75f827bf533fcc46a35a6fa1a80a8a8820..6c2f7b59ca7afa8bbe55917937210c990cb9d72c 100644 (file)
@@ -1,12 +1,16 @@
 # $Id$ $Revision$
 ## Process this file with automake to produce Makefile.in
 
+if WITH_CGRAPH
+GRAPH = cgraph
+else
+GRAPH = graph
+endif
+
 AM_CPPFLAGS = \
     -I$(top_srcdir) \
-       -I$(top_srcdir)/lib/gvc \
-       -I$(top_srcdir)/lib/pathplan \
        -I$(top_srcdir)/lib/common \
-       -I$(top_srcdir)/lib/graph \
+       -I$(top_srcdir)/lib/$(GRAPH) \
     -I$(top_srcdir)/lib/cdt
 
 noinst_HEADERS = xlabels.h index.h node.h rectangle.h split.q.h
index 4364c99e6af53f8dc1f270a56a67454d634f5e13..fba5da5408f05d0e03be5f7db2ab57a7c97a6ebc 100644 (file)
  * Contributors: See CVS logs. Details at http://www.graphviz.org/
  *************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "index.h"
 #include <stdio.h>
 #include <assert.h>
 #include "logic.h"
 #include "arith.h"
 #include "rectangle.h"
+#ifdef WITH_CGRAPH
+#include <cgraph.h>
+#else
+#include <graph.h>
+#endif
 
 #define Undefined(x) ((x)->boundary[0] > (x)->boundary[NUMDIMS])
 
@@ -116,7 +125,6 @@ void PrintRect(Rect_t * r)
 /*-----------------------------------------------------------------------------
 | Calculate the n-dimensional area of a rectangle
 -----------------------------------------------------------------------------*/
-void agerror(char *);
 
 #if SIZEOF_LONG_LONG > SIZEOF_INT
 unsigned int RectArea(Rect_t * r)
@@ -135,7 +143,7 @@ unsigned int RectArea(Rect_t * r)
     for (i = 0; i < NUMDIMS; i++) {
       long long a_test = area * r->boundary[i + NUMDIMS] - r->boundary[i];
       if( a_test > UINT_MAX) {
-       agerror("label: area too large for rtree\n");
+       agerr (AGERR, "label: area too large for rtree\n");
        return UINT_MAX;
       }
       area = a_test;
@@ -159,7 +167,7 @@ unsigned int RectArea(Rect_t * r)
       unsigned int b = r->boundary[i + NUMDIMS] - r->boundary[i];
       a *= b;
       if( (a / b ) != area) {
-       agerror("label: area too large for rtree\n");
+       agerr (AGERR, "label: area too large for rtree\n");
        return UINT_MAX;
       }
       area = a;