aboutsummaryrefslogtreecommitdiffstats
path: root/src/string_util.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-02 20:21:57 +0100
committerMax Kellermann <max@duempel.org>2013-01-02 20:22:59 +0100
commit4b0b8315a918be5ad92d5aeb0c7df6d28966b951 (patch)
tree4f1d395af63a903e1a831e27d296163c7b72473c /src/string_util.h
parenta654f146d1b39a363cb10853a7670ef099570e54 (diff)
downloadmpd-4b0b8315a918be5ad92d5aeb0c7df6d28966b951.tar.gz
mpd-4b0b8315a918be5ad92d5aeb0c7df6d28966b951.tar.xz
mpd-4b0b8315a918be5ad92d5aeb0c7df6d28966b951.zip
string_util: use const_cast in C++ mode
Diffstat (limited to 'src/string_util.h')
-rw-r--r--src/string_util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/string_util.h b/src/string_util.h
index 683fada1b..c1d316f0c 100644
--- a/src/string_util.h
+++ b/src/string_util.h
@@ -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
}
/**