Reliable detection of strerror_r variants

This commit is contained in:
Luis Diaz Mas
2019-01-06 10:07:49 +01:00
committed by D4N
parent 13c066dbb0
commit acc9fa012d
3 changed files with 13 additions and 9 deletions
+1 -9
View File
@@ -53,14 +53,6 @@
#include <algorithm>
#include <stdexcept>
#ifdef EXV_HAVE_STRERROR_R
#if defined(__GLIBC__) && defined(_GNU_SOURCE)
extern char *strerror_r(int errnum, char *buf, size_t n);
#else
extern int strerror_r(int errnum, char *buf, size_t n);
#endif
#endif
namespace Exiv2 {
const char* ENVARDEF[] = {"/exiv2.php", "40"}; //!< @brief default URL for http exiv2 handler and time-out
const char* ENVARKEY[] = {"EXIV2_HTTP_POST", "EXIV2_TIMEOUT"}; //!< @brief request keys for http exiv2 handler and time-out
@@ -348,7 +340,7 @@ namespace Exiv2 {
std::ostringstream os;
#ifdef EXV_HAVE_STRERROR_R
const size_t n = 1024;
#if defined(__GLIBC__) && defined(_GNU_SOURCE)
#ifdef EXV_STRERROR_R_CHAR_P
char *buf = 0;
char buf2[n];
std::memset(buf2, 0x0, n);