fix for GH #1501: Alpine 3.4 trouble with Foundation/src/Error.cpp

This commit is contained in:
Guenter Obiltschnig
2017-01-31 17:47:40 +01:00
parent 8ed7dfecc5
commit 960649d0ba

View File

@@ -66,13 +66,13 @@ namespace Poco {
without -D_GNU_SOURCE is needed, otherwise the GNU version is
preferred.
*/
#if defined _GNU_SOURCE && !POCO_ANDROID
char errmsg[256] = "";
return std::string(strerror_r(errorCode, errmsg, 256));
#elif (_XOPEN_SOURCE >= 600) || POCO_ANDROID
#if (_XOPEN_SOURCE >= 600) || POCO_ANDROID
char errmsg[256] = "";
strerror_r(errorCode, errmsg, 256);
return errmsg;
#elif defined _GNU_SOURCE
char errmsg[256] = "";
return std::string(strerror_r(errorCode, errmsg, 256));
#else
return std::string(strerror(errorCode));
#endif