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>(int(*)(int)) is being passed
 extern "C" int(*)(int).

Add an intermediate C++ function to forward to the C function.
This commit is contained in:
Brad King 2012-09-10 08:33:41 -04:00
parent 4e62784bf6
commit d0c863f60f
1 changed files with 8 additions and 1 deletions

View File

@ -13,6 +13,12 @@
#include "cmDocumentationSection.h" #include "cmDocumentationSection.h"
#include <algorithm> #include <algorithm>
#include <ctype.h> // for isalnum #include <ctype.h> // for isalnum
static int cmIsAlnum(int c)
{
return isalnum(c);
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// this function is a copy of the one in the HTML formatter // this function is a copy of the one in the HTML formatter
@ -224,7 +230,8 @@ void cmDocumentationFormatterDocbook::PrintFooter(std::ostream& os)
void cmDocumentationFormatterDocbook void cmDocumentationFormatterDocbook
::PrintId(std::ostream& os, const char* prefix, std::string id) ::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) if(prefix)
{ {
id = std::string(prefix) + "." + id; id = std::string(prefix) + "." + id;