From 9790cf5db9fb8b5422a698a296d7391cf82410b5 Mon Sep 17 00:00:00 2001 From: Michael Maclean Date: Thu, 19 Sep 2013 00:03:46 +0100 Subject: [PATCH] Properly detect which variant of strerror_r we have --- config.m4 | 2 ++ mosquitto.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.m4 b/config.m4 index 48a46df..4776799 100644 --- a/config.m4 +++ b/config.m4 @@ -44,4 +44,6 @@ if test "$PHP_MOSQUITTO" != "no"; then PHP_SUBST(MOSQUITTO_SHARED_LIBADD) PHP_NEW_EXTENSION(mosquitto, mosquitto.c, $ext_shared) + + AC_FUNC_STRERROR_R fi diff --git a/mosquitto.c b/mosquitto.c index e410eb5..9361abf 100644 --- a/mosquitto.c +++ b/mosquitto.c @@ -201,7 +201,7 @@ char *strerror_wrapper(int err) { char *buf = ecalloc(256, sizeof(char)); POSSIBLY_UNUSED char *bbuf = buf; -#ifdef _GNU_SOURCE +#ifdef STRERROR_R_CHAR_P bbuf = #endif strerror_r(err, buf, 256);