31#ifndef PNGPP_ERROR_HPP_INCLUDED
32#define PNGPP_ERROR_HPP_INCLUDED
35#ifdef __STDC_LIB_EXT1__
36#define __STDC_WANT_LIB_EXT1__ 1
39#define HAVE_STRERROR_S 1
58 :
public std::runtime_error
64 explicit error(std::string
const& message)
65 : std::runtime_error(message)
77 :
public std::runtime_error
88 explicit std_error(std::string
const& message,
int errnum = errno)
96#define ERRBUF_SIZE 512
97 char buf[ERRBUF_SIZE] = { 0 };
100 strerror_s(buf, ERRBUF_SIZE, errnum);
101 return std::string(buf);
103#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) || (!__GLIBC__)
104 strerror_r(errnum, buf, ERRBUF_SIZE);
105 return std::string(buf);
108 return std::string(strerror_r(errnum, buf, ERRBUF_SIZE));
Exception class to represent runtime errors related to png++ operation.
Definition: error.hpp:59
error(std::string const &message)
Definition: error.hpp:64
Exception class to represent standard library errors (generally IO).
Definition: error.hpp:78
static std::string thread_safe_strerror(int errnum)
Definition: error.hpp:94
std_error(std::string const &message, int errnum=errno)
Definition: error.hpp:88