From: ellson Date: Mon, 2 Mar 2009 17:46:34 +0000 (+0000) Subject: move agferror() to graphio.c where its needed X-Git-Tag: LAST_LIBGRAPH~32^2~2343 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0a7d4b7ea1e2cadb0d0ed89bc7f4f0b31dd07b1;p=graphviz move agferror() to graphio.c where its needed --- diff --git a/lib/graph/attribs.c b/lib/graph/attribs.c index 83973cf33..8e223376c 100644 --- a/lib/graph/attribs.c +++ b/lib/graph/attribs.c @@ -324,14 +324,6 @@ Agsym_t *agprvattr(void *obj, Agsym_t *a) return (Agsym_t *)dtprev(dict->dict, a); } -#if defined(__SUNPRO_C) || defined(__CYGWIN__) || defined(__MINGW32__) -/* for systems where ferror is a macro */ -static int agferror(FILE *stream) -{ - return ferror(stream); -} -#endif - /* this is normally called by the aginit() macro */ void aginitlib(int gs, int ns, int es) { @@ -340,13 +332,6 @@ void aginitlib(int gs, int ns, int es) AG.node_nbytes = ns; AG.edge_nbytes = es; AG.init_called = TRUE; - AG.fwrite = fwrite; /* init to system version of fwrite() */ -#if defined(__SUNPRO_C) || defined(__CYGWIN__) || defined(__MINGW32__) -#undef ferror - AG.ferror = agferror; /* init to ferror macro wrapper function */ -#else - AG.ferror = ferror; /* init to system version of ferror() */ -#endif initproto(); } else if ((AG.graph_nbytes != gs) || (AG.node_nbytes != ns) diff --git a/lib/graph/graphio.c b/lib/graph/graphio.c index f9e255cf6..6da3fe5de 100644 --- a/lib/graph/graphio.c +++ b/lib/graph/graphio.c @@ -581,6 +581,15 @@ static void free_printdict_t(printdict_t * dict) free(dict); } +#if defined(__SUNPRO_C) || defined(__CYGWIN__) || defined(__MINGW32__) +/* for systems where ferror is a macro */ +static int agferror(FILE *stream) +{ + return ferror(stream); +} +#endif + + int agwrite(Agraph_t * g, FILE * fp) { printdict_t *p;