From: Erwin Janssen Date: Fri, 31 Mar 2017 11:06:41 +0000 (+0200) Subject: Remove HAVE_LIBGD check from plugin/gd X-Git-Tag: 2.42.0~184^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea8a74a6adf2fc9bd862c0df0a8ed7df4953442d;p=graphviz Remove HAVE_LIBGD check from plugin/gd This check should exist only in the build configuration, if plugin/gd gets build, then libgd should _always_ be available. Otherwise, mistakenly building plugin/gd without defining HAVE_LIBGD, will lead to believe that the build is succesfull, while in truth nothing gets build. --- diff --git a/plugin/gd/gvdevice_gd.c b/plugin/gd/gvdevice_gd.c index 9d1a542aa..5f67f1a58 100644 --- a/plugin/gd/gvdevice_gd.c +++ b/plugin/gd/gvdevice_gd.c @@ -16,7 +16,6 @@ #include "gvplugin_device.h" #include "gvio.h" -#ifdef HAVE_LIBGD #include "gd.h" int gvdevice_gd_putBuf (gdIOCtx *context, const void *buffer, int len) @@ -182,10 +181,8 @@ static gvdevice_features_t device_features_gd_no_writer = { {96.,96.}, /* dpi */ }; #endif -#endif gvplugin_installed_t gvdevice_gd_types[] = { -#ifdef HAVE_LIBGD #ifdef HAVE_PANGOCAIRO #ifdef HAVE_GD_GIF @@ -213,7 +210,6 @@ gvplugin_installed_t gvdevice_gd_types[] = { #endif #endif -#endif #endif {0, NULL, 0, NULL, NULL} }; diff --git a/plugin/gd/gvloadimage_gd.c b/plugin/gd/gvloadimage_gd.c index b60883257..8953aec96 100644 --- a/plugin/gd/gvloadimage_gd.c +++ b/plugin/gd/gvloadimage_gd.c @@ -23,8 +23,6 @@ #include "gvplugin_loadimage.h" #include "gvio.h" - -#ifdef HAVE_LIBGD #include "gd.h" typedef enum { @@ -267,11 +265,7 @@ static gvloadimage_engine_t engine_cairo = { }; #endif -#endif - gvplugin_installed_t gvloadimage_gd_types[] = { -#ifdef HAVE_LIBGD - {FORMAT_GD_GD, "gd:gd", 1, &engine, NULL}, {FORMAT_GD2_GD, "gd2:gd", 1, &engine, NULL}, #ifdef HAVE_GD_GIF @@ -342,7 +336,5 @@ gvplugin_installed_t gvloadimage_gd_types[] = { {FORMAT_XBM_CAIRO, "xbm:cairo", 1, &engine_cairo, NULL}, #endif #endif /* HAVE_PANGOCAIRO */ - -#endif /* HAVE_LIBGD */ {0, NULL, 0, NULL, NULL} }; diff --git a/plugin/gd/gvrender_gd.c b/plugin/gd/gvrender_gd.c index 5008754f0..4c500a332 100644 --- a/plugin/gd/gvrender_gd.c +++ b/plugin/gd/gvrender_gd.c @@ -25,8 +25,6 @@ #include "gvplugin_render.h" #include "gvplugin_device.h" #include "gvcint.h" /* for gvc->g for agget */ - -#ifdef HAVE_LIBGD #include "gd.h" #ifndef INT32_MAX @@ -666,17 +664,12 @@ static gvdevice_features_t device_features_gd_tc_no_writer = { {96.,96.}, /* default dpi */ }; -#endif - gvplugin_installed_t gvrender_gd_types[] = { -#ifdef HAVE_LIBGD {FORMAT_GD, "gd", 1, &gdgen_engine, &render_features_gd}, -#endif {0, NULL, 0, NULL, NULL} }; gvplugin_installed_t gvdevice_gd_types2[] = { -#ifdef HAVE_LIBGD #ifdef HAVE_GD_GIF {FORMAT_GIF, "gif:gd", 1, NULL, &device_features_gd_tc}, /* pretend gif is truecolor because it supports transparency */ {FORMAT_WBMP, "wbmp:gd", 1, NULL, &device_features_gd}, @@ -703,8 +696,6 @@ gvplugin_installed_t gvdevice_gd_types2[] = { #ifdef HAVE_GD_XPM {FORMAT_XBM, "xbm:gd", 1, NULL, &device_features_gd}, #endif -#endif - #endif {0, NULL, 0, NULL, NULL} }; diff --git a/plugin/gd/gvrender_gd_vrml.c b/plugin/gd/gvrender_gd_vrml.c index ac97d4785..d350b64ff 100644 --- a/plugin/gd/gvrender_gd_vrml.c +++ b/plugin/gd/gvrender_gd_vrml.c @@ -21,8 +21,6 @@ #include "gvplugin_render.h" #include "gvio.h" - -#ifdef HAVE_LIBGD #include "gd.h" #ifdef HAVE_GD_PNG @@ -838,22 +836,17 @@ static gvdevice_features_t device_features_vrml = { {72.,72.}, /* default dpi */ }; #endif /* HAVE_GD_PNG */ -#endif /* HAVE_LIBGD */ gvplugin_installed_t gvrender_vrml_types[] = { -#ifdef HAVE_LIBGD #ifdef HAVE_GD_PNG {FORMAT_VRML, "vrml", 1, &vrml_engine, &render_features_vrml}, -#endif #endif {0, NULL, 0, NULL, NULL} }; gvplugin_installed_t gvdevice_vrml_types[] = { -#ifdef HAVE_LIBGD #ifdef HAVE_GD_PNG {FORMAT_VRML, "vrml:vrml", 1, NULL, &device_features_vrml}, -#endif #endif {0, NULL, 0, NULL, NULL} }; diff --git a/plugin/gd/gvtextlayout_gd.c b/plugin/gd/gvtextlayout_gd.c index 93d4fe480..867c51177 100644 --- a/plugin/gd/gvtextlayout_gd.c +++ b/plugin/gd/gvtextlayout_gd.c @@ -17,11 +17,9 @@ #include #include #include "gvplugin_textlayout.h" - -#ifdef HAVE_LIBGD #include "gd.h" -#if defined(HAVE_LIBGD) && defined(HAVE_GD_FREETYPE) +#ifdef HAVE_GD_FREETYPE /* fontsize at which text is omitted entirely */ #define FONTSIZE_MUCH_TOO_SMALL 0.15 @@ -197,10 +195,9 @@ static gvtextlayout_engine_t gd_textlayout_engine = { gd_textlayout, }; #endif -#endif gvplugin_installed_t gvtextlayout_gd_types[] = { -#if defined(HAVE_LIBGD) && defined(HAVE_GD_FREETYPE) +#ifdef HAVE_GD_FREETYPE {0, "textlayout", 2, &gd_textlayout_engine, NULL}, #endif {0, NULL, 0, NULL, NULL}