diff options
author | Brad King <brad.king@kitware.com> | 2012-09-10 12:33:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-10 13:41:37 (GMT) |
commit | d0c863f60f55d618f6b1c5dcdae0b8b3acff1f35 (patch) | |
tree | 7c19a77ef62a9d2d6390fdb89d53f6b5d4a36d96 | |
parent | 4e62784bf6c00bc01fd21dc08cac84b260ec9c11 (diff) | |
download | CMake-d0c863f60f55d618f6b1c5dcdae0b8b3acff1f35.zip CMake-d0c863f60f55d618f6b1c5dcdae0b8b3acff1f35.tar.gz CMake-d0c863f60f55d618f6b1c5dcdae0b8b3acff1f35.tar.bz2 |
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.
-rw-r--r-- | Source/cmDocumentationFormatterDocbook.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
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 <algorithm> #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 @@ -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; |