[libcxx-commits] [PATCH] D150015: [libc++] Consistently enable __CORRECT_ISO_CPP_WCHAR_H_PROTO in mbstate.

Fangrui Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 6 12:05:53 PDT 2023


MaskRay added inline comments.


================
Comment at: libcxx/include/__mbstate_t.h:33
+#ifdef __cplusplus
+#  define __CORRECT_ISO_CPP_WCHAR_H_PROTO
+#endif
----------------
Mordante wrote:
> This looks wrong. When users include both `wchar.h` and `uchar.h` the system may try to define `__CORRECT_ISO_CPP_WCHAR_H_PROTO` twice.
This is fine. For
```
#  define __CORRECT_ISO_CPP_WCHAR_H_PROTO
#  define __CORRECT_ISO_CPP_WCHAR_H_PROTO
```

The two replacement lists (empty) are identical and are allowed. Actually, this is what will happen with a glibc newer than 2019-12 (https://sourceware.org/bugzilla/show_bug.cgi?id=25232). glibc `wchar.h` defines the macro `__CORRECT_ISO_CPP_WCHAR_H_PROTO` as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150015/new/

https://reviews.llvm.org/D150015



More information about the libcxx-commits mailing list