Port: replace strerror_r() with glib g_strerror()
[babeltrace.git] / include / babeltrace / compat / string.h
index 609261613fe8d4d3d75ed833b02bb8404929ae6a..c3325a3b11a6c654f56af4badeb0c1ef3dab23cf 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
-#if !defined(__GLIBC__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
-
-/* XSI-compliant strerror_r */
-static inline
-int compat_strerror_r(int errnum, char *buf, size_t buflen)
-{
-       return strerror_r(errnum, buf, buflen);
-}
-
-#else
-
-/* GNU-compliant strerror_r */
-static inline
-int compat_strerror_r(int errnum, char *buf, size_t buflen)
-{
-       char *retbuf;
-
-       retbuf = strerror_r(errnum, buf, buflen);
-       if (retbuf != buf)
-               strncpy(buf, retbuf, buflen);
-       buf[buflen - 1] = '\0';
-       return 0;
-}
-
-#endif
-
 #ifdef HAVE_STRNLEN
 static inline
 size_t bt_strnlen(const char *str, size_t max)
This page took 0.023741 seconds and 4 git commands to generate.