*: remove remaining __cplusplus checks

This commit is contained in:
Max Kellermann
2013-08-07 19:58:52 +02:00
parent dff05c71e6
commit abe090ec1f
8 changed files with 1 additions and 77 deletions

View File

@@ -22,28 +22,6 @@
#include "gcc.h"
/**
* Remove the "const" attribute from a string pointer. This is a
* dirty hack, don't use it unless you know what you're doing!
*/
gcc_const
static inline char *
deconst_string(const char *p)
{
#ifdef __cplusplus
return const_cast<char *>(p);
#else
union {
const char *in;
char *out;
} u = {
.in = p,
};
return u.out;
#endif
}
/**
* Returns a pointer to the first non-whitespace character in the
* string, or to the end of the string.
@@ -62,7 +40,7 @@ gcc_pure
static inline char *
strchug_fast(char *p)
{
return deconst_string(strchug_fast_c(p));
return const_cast<char *>(strchug_fast_c(p));
}
/**