diff --git a/mediachanger/castorrmc/common/strerror_r_wrapper.cpp b/mediachanger/castorrmc/common/strerror_r_wrapper.cpp index 77f8670143a834c9adbd2e25e18e894f720c5f20..09273390d903b858cddae9528683e3fd431d5221 100644 --- a/mediachanger/castorrmc/common/strerror_r_wrapper.cpp +++ b/mediachanger/castorrmc/common/strerror_r_wrapper.cpp @@ -38,6 +38,6 @@ /******************************************************************************* * strerror_r_wrapper ******************************************************************************/ -extern "C" int strerror_r_wrapper(int errnum, char *buf, unsigned int buflen) { +extern "C" int strerror_r_wrapper(int errnum, char *buf, size_t buflen) { return strerror_r(errnum, buf, buflen); } diff --git a/mediachanger/castorrmc/h/strerror_r_wrapper.h b/mediachanger/castorrmc/h/strerror_r_wrapper.h index 1eaeebf332b15de55fbddd4ace5c74d1d9cb7a7f..059bd065ef404870198daed1997768d52987495a 100644 --- a/mediachanger/castorrmc/h/strerror_r_wrapper.h +++ b/mediachanger/castorrmc/h/strerror_r_wrapper.h @@ -27,6 +27,19 @@ #include <stddef.h> +/* The following EXTERN_C marco has been intentionally copied from */ +/* h/osdep.h instead of just including h/osdep.h. The reason for this is */ +/* this header file must include the minimum number of header files because */ +/* the implementation file common/strerror_r_wrapper.cpp will undefine */ +/* _GNU_SOURCE and define _XOPEN_SOURCE as being 600. */ +/* */ +/* Macros for externalization (UNIX) (J.-D.Durand) */ +#if defined(__cplusplus) +#define EXTERN_C extern "C" +#else +#define EXTERN_C extern +#endif + /** * This function wraps the XSI compliant version of strerror_r() and therefore * writes the string representation of the specified error number to the @@ -36,6 +49,6 @@ * @param buf The buffer. * @param buflen The length of the buffer. */ -int strerror_r_wrapper(int errnum, char *buf, size_t buflen); +EXTERN_C int strerror_r_wrapper(int errnum, char *buf, size_t buflen); #endif /* H_STRERROR_R_WRAPPER_H */