diff options
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/str_util.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/wsutil/str_util.h b/wsutil/str_util.h index c43e2e05de..302afd0096 100644 --- a/wsutil/str_util.h +++ b/wsutil/str_util.h @@ -25,6 +25,10 @@ #ifndef __STR_UTIL_H__ #define __STR_UTIL_H__ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /** Convert all upper-case ASCII letters to their ASCII lower-case * equivalents, in place, with a simple non-locale-dependent * ASCII mapping (A-Z -> a-z). @@ -84,6 +88,13 @@ typedef enum { /* XXX format_size_prefix_default_for_this_particular_os ? */ } format_size_flags_e; +#ifdef __cplusplus +/* Should we just have separate unit and prefix enums instead? */ +format_size_flags_e operator|(format_size_flags_e lhs, format_size_flags_e rhs) { + return (format_size_flags_e) ((int)lhs| (int)rhs); +} +#endif /* __cplusplus */ + /** Given a size, return its value in a human-readable format * * Prefixes up to "T/Ti" (tera, tebi) are currently supported. @@ -95,4 +106,9 @@ typedef enum { */ gchar *format_size(gint64 size, format_size_flags_e flags); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* __STR_UTIL_H__ */ |