jimloco/Csocket — Issue #8: Compilation fails on OS X (e00323f9f1)
Author: stephank
Created: 2012-01-14 22:56:54+00:00
State: open

# clang++ -c -o Csocket.o Csocket.cc
Csocket.cc:591:8: error: cannot initialize return object of type 'const char *' with an rvalue of type 'int'
return( strerror_r( iErrno, pszBuff, uBuffLen ) );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

(Also happens with GCC.)

Pretty much, OS X only provides the POSIX compliant `strerror_r` with an `int` return type.

Perhaps the feature test should simply be `!defined( _GNU_SOURCE )`? Not sure, though.