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:
parent
4e62784bf6
commit
d0c863f60f
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue