mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] uchar.h: define char16_t and char32_t for old c++
@ 2018-07-08 13:19 Szabolcs Nagy
  2018-07-09  9:20 ` Joakim Sindholt
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2018-07-08 13:19 UTC (permalink / raw)
  To: musl

including uchar.h in c++ code is only well defined in c++11 onwards
where char16_t and char32_t type definitions must be hidden since they
are keywords.  however some c++ code compiled for older c++ standard
include uchar.h too and they need the typedefs, this fix makes such
code work.
---
 include/uchar.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/uchar.h b/include/uchar.h
index 8dabf1ed..7e5c4d40 100644
--- a/include/uchar.h
+++ b/include/uchar.h
@@ -3,7 +3,9 @@
 
 #ifdef __cplusplus
 extern "C" {
-#else
+#endif
+
+#if __cplusplus < 201103L
 typedef unsigned short char16_t;
 typedef unsigned char32_t;
 #endif
-- 
2.16.3



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-09 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-08 13:19 [PATCH] uchar.h: define char16_t and char32_t for old c++ Szabolcs Nagy
2018-07-09  9:20 ` Joakim Sindholt
2018-07-09 12:58   ` Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).