Commit 4b0b8315 authored by Max Kellermann's avatar Max Kellermann

string_util: use const_cast in C++ mode

parent a654f146
......@@ -32,6 +32,9 @@ gcc_const
static inline char *
deconst_string(const char *p)
{
#ifdef __cplusplus
return const_cast<char *>(p);
#else
union {
const char *in;
char *out;
......@@ -40,6 +43,7 @@ deconst_string(const char *p)
};
return u.out;
#endif
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment