Skip to content

Commit

Permalink
dropped usage of gs_error_names()
Browse files Browse the repository at this point in the history
because it's no longer accessible as of GS 10.0.0
(closes #195)
  • Loading branch information
mgieseki committed Sep 23, 2022
1 parent 0213b92 commit 9bf81fd
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/Ghostscript.cpp
Expand Up @@ -375,19 +375,9 @@ const char* Ghostscript::error_name (int code) {
if (code < 0)
code = -code;
const char *error_names[] = { ERROR_NAMES };
if (code == 0 || (size_t)code > sizeof(error_names)/sizeof(error_names[0]))
if (code == 0 || size_t(code) > sizeof(error_names)/sizeof(error_names[0]))
return nullptr;
#if defined(HAVE_LIBGS)
// use array defined in libgs to avoid linking the error strings into the binary
return gs_error_names[code-1];
#elif defined(_WIN32)
// gs_error_names is private in the Ghostscript DLL so we can't access it here
return error_names[code-1];
#else
if (auto error_names = loadSymbol<const char**>("gs_error_names"))
return error_names[code-1];
return nullptr;
#endif
}

#endif // !DISABLE_GS

0 comments on commit 9bf81fd

Please sign in to comment.