Merge branch '0.27' into ExpatAdapter-0.27

v0.27.3
Robin Mills 7 years ago committed by GitHub
commit eebf6e982e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,6 +27,9 @@
// Define if you have the strerror_r function. // Define if you have the strerror_r function.
#cmakedefine EXV_HAVE_STRERROR_R #cmakedefine EXV_HAVE_STRERROR_R
// Define if the strerror_r function returns char*.
#cmakedefine EXV_STRERROR_R_CHAR_P
// Define to enable the Windows unicode path support. // Define to enable the Windows unicode path support.
#cmakedefine EXV_UNICODE_PATH #cmakedefine EXV_UNICODE_PATH

@ -1,4 +1,5 @@
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckCXXSourceCompiles)
# Note that the scope of the EXV_ variables in local # Note that the scope of the EXV_ variables in local
if (${EXIV2_ENABLE_WEBREADY}) if (${EXIV2_ENABLE_WEBREADY})
@ -28,6 +29,14 @@ check_function_exists( mmap EXV_HAVE_MMAP )
check_function_exists( munmap EXV_HAVE_MUNMAP ) check_function_exists( munmap EXV_HAVE_MUNMAP )
check_function_exists( strerror_r EXV_HAVE_STRERROR_R ) check_function_exists( strerror_r EXV_HAVE_STRERROR_R )
check_cxx_source_compiles( "
#include <string.h>
int main() {
char buff[100];
const char* c = strerror_r(0,buff,100);
return 0;
}" EXV_STRERROR_R_CHAR_P )
check_include_file( "unistd.h" EXV_HAVE_UNISTD_H ) check_include_file( "unistd.h" EXV_HAVE_UNISTD_H )
check_include_file( "memory.h" EXV_HAVE_MEMORY_H ) check_include_file( "memory.h" EXV_HAVE_MEMORY_H )
check_include_file( "process.h" EXV_HAVE_PROCESS_H ) check_include_file( "process.h" EXV_HAVE_PROCESS_H )

@ -53,14 +53,6 @@
#include <algorithm> #include <algorithm>
#include <stdexcept> #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 { namespace Exiv2 {
const char* ENVARDEF[] = {"/exiv2.php", "40"}; //!< @brief default URL for http exiv2 handler and time-out 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 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; std::ostringstream os;
#ifdef EXV_HAVE_STRERROR_R #ifdef EXV_HAVE_STRERROR_R
const size_t n = 1024; const size_t n = 1024;
#if defined(__GLIBC__) && defined(_GNU_SOURCE) #ifdef EXV_STRERROR_R_CHAR_P
char *buf = 0; char *buf = 0;
char buf2[n]; char buf2[n];
std::memset(buf2, 0x0, n); std::memset(buf2, 0x0, n);

Loading…
Cancel
Save