]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unicode/char16ptr.h
ICU-66108.tar.gz
[apple/icu.git] / icuSources / common / unicode / char16ptr.h
index baddd9bd87dd1129957789f9d9076aa25e0dbfbf..c8a9ae6c35d646f7173d4fff6d5068914ce9408c 100644 (file)
@@ -7,9 +7,12 @@
 #ifndef __CHAR16PTR_H__
 #define __CHAR16PTR_H__
 
-#include <cstddef>
 #include "unicode/utypes.h"
 
+#if U_SHOW_CPLUSPLUS_API
+
+#include <cstddef>
+
 /**
  * \file
  * \brief C++ API: char16_t pointer wrappers with
@@ -17,7 +20,6 @@
  *        Also conversion functions from char16_t * to UChar * and OldUChar *.
  */
 
-#if U_SHOW_CPLUSPLUS_API
 U_NAMESPACE_BEGIN
 
 /**
@@ -29,6 +31,8 @@ U_NAMESPACE_BEGIN
     // Use the predefined value.
 #elif (defined(__clang__) || defined(__GNUC__)) && U_PLATFORM != U_PF_BROWSER_NATIVE_CLIENT
 #   define U_ALIASING_BARRIER(ptr) asm volatile("" : : "rm"(ptr) : "memory")
+#elif defined(U_IN_DOXYGEN)
+#   define U_ALIASING_BARRIER(ptr)
 #endif
 
 /**
@@ -104,6 +108,7 @@ private:
 #endif
 };
 
+/// \cond
 #ifdef U_ALIASING_BARRIER
 
 Char16Ptr::Char16Ptr(char16_t *p) : p_(p) {}
@@ -135,6 +140,7 @@ Char16Ptr::~Char16Ptr() {}
 char16_t *Char16Ptr::get() const { return u_.cp; }
 
 #endif
+/// \endcond
 
 /**
  * const char16_t * wrapper with implicit conversion from distinct but bit-compatible pointer types.
@@ -210,6 +216,7 @@ private:
 #endif
 };
 
+/// \cond
 #ifdef U_ALIASING_BARRIER
 
 ConstChar16Ptr::ConstChar16Ptr(const char16_t *p) : p_(p) {}
@@ -241,6 +248,7 @@ ConstChar16Ptr::~ConstChar16Ptr() {}
 const char16_t *ConstChar16Ptr::get() const { return u_.cp; }
 
 #endif
+/// \endcond
 
 /**
  * Converts from const char16_t * to const UChar *.
@@ -299,6 +307,7 @@ inline OldUChar *toOldUCharPtr(char16_t *p) {
 }
 
 U_NAMESPACE_END
-#endif // U_SHOW_CPLUSPLUS_API
+
+#endif /* U_SHOW_CPLUSPLUS_API */
 
 #endif  // __CHAR16PTR_H__