From 4eea186240e6ebb2d74e9a4883dffc836b9c1642 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Sat, 3 Apr 2010 05:41:42 +0000 Subject: [PATCH] #688: Stronger check for return type of strrerror_r. (Nikolai Saoukh) --- config/ConfigureChecks.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/config/ConfigureChecks.cmake b/config/ConfigureChecks.cmake index c0492363..1ae230dc 100644 --- a/config/ConfigureChecks.cmake +++ b/config/ConfigureChecks.cmake @@ -144,12 +144,10 @@ return 0; endif( HAVE_SYS_TIME_H ) # strerror_r returns char* -check_c_source_compiles( "#include -int main() { -char * c; -c = strerror_r(0,c,0); -return 0; -}" STRERROR_R_CHAR_P ) +check_cxx_source_compiles( " +#include +int dfunc() { char cb[12]; return *(strerror_r(1, cb, sizeof(cb))) == '\0'; } +" STRERROR_R_CHAR_P ) #function is declared with the above if( STRERROR_R_CHAR_P )