Project

General

Profile

Patch #688 » strchar.patch

Nikolai Saoukh, 08 Mar 2010 20:46

View differences:

src/futils.cpp (working copy)
92 92
        std::ostringstream os;
93 93
#ifdef EXV_HAVE_STRERROR_R
94 94
        const size_t n = 1024;
95
// _GNU_SOURCE: See Debian bug #485135
96
# if defined EXV_STRERROR_R_CHAR_P || defined _GNU_SOURCE
95
# if defined EXV_STRERROR_R_CHAR_P
97 96
        char *buf = 0;
98 97
        char buf2[n];
99 98
        std::memset(buf2, 0x0, n);
config/ConfigureChecks.cmake (working copy)
144 144
endif( HAVE_SYS_TIME_H )
145 145

  
146 146
# strerror_r returns char*
147
check_c_source_compiles( "#include <string.h>
148
int main() {
149
char * c;
150
c = strerror_r(0,c,0);
151
return 0;
152
}" STRERROR_R_CHAR_P )
147
check_cxx_source_compiles( "
148
#include <cstring>
149
int dfunc() { char cb[12]; return *(strerror_r(1, cb, sizeof(cb))) == '\0'; }
150
" STRERROR_R_CHAR_P )
153 151

  
154 152
#function is declared with the above
155 153
if( STRERROR_R_CHAR_P )
(2-2/2)