]> git.ipfire.org Git - thirdparty/freeswitch.git/commit
FreeSWITCH: Add switch_strerror_r() to fix problems with XSI and GNU variants of...
authorStefan Knoblich <stkn@openisdn.net>
Tue, 14 Aug 2012 12:11:44 +0000 (14:11 +0200)
committerStefan Knoblich <stkn@openisdn.net>
Tue, 14 Aug 2012 12:11:44 +0000 (14:11 +0200)
commit8bcf3b4fb858a838e5a623ec417a93540fa43f2b
tree6117cacb166fb37109f8cf775b8eec5d714517dc
parent3d9d42b7980be68f7090193d800f94dbd003af47
FreeSWITCH: Add switch_strerror_r() to fix problems with XSI and GNU variants of strerror_r().

GNU variant of strerror_r() returns char *, while the XSI version returns int.

To make things worse, glibc ships both and added a unused result warning
in recent versions (2.16) causing the build to fail.

Add our own custom wrapper that always returns a pointer to the message buffer
and additionally make XSI versions of strerror_r() GNU compatible by
returning "Unknown error xxx" if no error message is available.

Fixes:
    src/switch_rtp.c: In function 'rtp_common_read':
    src/switch_rtp.c:3313:15: error: ignoring return value of 'strerror_r',
    declared with attribute warn_unused_result [-Werror=unused-result]
    cc1: all warnings being treated as errors

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
configure.in
src/include/switch_utils.h
src/switch_rtp.c
src/switch_utils.c