Fix subtly broken libgd version check

This commit is contained in:
sfan5 2018-03-24 18:40:21 +01:00 committed by GitHub
parent 6af6be4632
commit 0f36b6e37a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,7 @@ void Image::drawCircle(int x, int y, int diameter, const Color &c)
void Image::save(const std::string &filename)
{
#if (GD_MAJOR_VERSION == 2 && GD_MINOR_VERSION >= 1 && GD_RELEASE_VERSION >= 1) || GD_MAJOR_VERSION > 2
#if (GD_MAJOR_VERSION == 2 && GD_MINOR_VERSION == 1 && GD_RELEASE_VERSION >= 1) || (GD_MAJOR_VERSION == 2 && GD_MINOR_VERSION > 1) || GD_MAJOR_VERSION > 2
const char *f = filename.c_str();
if (gdSupportsFileType(f, 1) == GD_FALSE)
throw std::runtime_error("Image format not supported by gd");