From db1cda26539c711c3da7ed4d410dfe8190e89b8f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 3 Aug 2019 12:12:40 -0400 Subject: convert_UTF: rewrite in C++ This allows us to namespace the symbols properly. Bug: google-breakpad:725 Change-Id: Iea8052547eef6c0acb299c1995781735c6d8994f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1769236 Reviewed-by: Mark Mentovai --- src/common/convert_UTF.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/common/convert_UTF.h') diff --git a/src/common/convert_UTF.h b/src/common/convert_UTF.h index 644d0995..2f69495d 100644 --- a/src/common/convert_UTF.h +++ b/src/common/convert_UTF.h @@ -106,6 +106,8 @@ All should be unsigned values to avoid sign extension during bit mask & shift operations. ------------------------------------------------------------------------ */ +namespace google_breakpad { + typedef unsigned long UTF32; /* at least 32 bits */ typedef unsigned short UTF16; /* at least 16 bits */ typedef unsigned char UTF8; /* typically 8 bits */ @@ -130,11 +132,6 @@ typedef enum { lenientConversion } ConversionFlags; -/* This is for C++ and does no harm in C */ -#ifdef __cplusplus -extern "C" { -#endif - ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); @@ -155,9 +152,7 @@ ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* so Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); -#ifdef __cplusplus -} -#endif +} // namespace google_breakpad /* --------------------------------------------------------------------- */ -- cgit v1.2.1