From d0c863f60f55d618f6b1c5dcdae0b8b3acff1f35 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 10 Sep 2012 08:33:41 -0400 Subject: docbook: Fix Sun CC warning on ptr_fun(isalnum) The Sun compiler complains: cmDocumentationFormatterDocbook.cxx", line 230: Warning (Anachronism), badargtype2w: Formal argument x of type int(*)(int) in call to std::ptr_fun(int(*)(int)) is being passed extern "C" int(*)(int). Add an intermediate C++ function to forward to the C function. --- Source/cmDocumentationFormatterDocbook.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/cmDocumentationFormatterDocbook.cxx b/Source/cmDocumentationFormatterDocbook.cxx index a2ae20b..706ce0a 100644 --- a/Source/cmDocumentationFormatterDocbook.cxx +++ b/Source/cmDocumentationFormatterDocbook.cxx @@ -13,6 +13,12 @@ #include "cmDocumentationSection.h" #include #include // for isalnum + +static int cmIsAlnum(int c) +{ + return isalnum(c); +} + //---------------------------------------------------------------------------- // this function is a copy of the one in the HTML formatter @@ -224,7 +230,8 @@ void cmDocumentationFormatterDocbook::PrintFooter(std::ostream& os) void cmDocumentationFormatterDocbook ::PrintId(std::ostream& os, const char* prefix, std::string id) { - std::replace_if(id.begin(), id.end(), std::not1(std::ptr_fun(isalnum)), '_'); + std::replace_if(id.begin(), id.end(), + std::not1(std::ptr_fun(cmIsAlnum)), '_'); if(prefix) { id = std::string(prefix) + "." + id; -- cgit v0.12