OpenBSD CVS

CVS log for src/include/uchar.h


[BACK] Up to [local] / src / include

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.2 / (download) - annotate - [select for diffs], Tue Sep 5 23:16:01 2023 UTC (8 months, 1 week ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.1: +3 -1 lines
Diff to previous 1.1 (colored)

According to the C11 standard, char32_t and char16_t are not part
of the C language but are part of the C library and have to be
declared in <uchar.h> - see paragraph 7.28.2.

In stark contrast, according to the C++11 standard, char32_t and char16_t
are part of the C++ language, namely, keywords - see paragraph 2.12.1.
Consequently, they must not be declared in a header file.

To resolve this vile contradiction, use the predefined macro __cplusplus
to find out which language is in use for the current compilation unit -
see C11 paragraph 6.10.8.3 and C++11 paragraph 16.8.1.

Reminded of the problem by naddy@.
OK naddy@ who tested in make build / make release.
Looks reasonable to millert@.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Aug 20 15:02:50 2023 UTC (8 months, 4 weeks ago) by schwarze
Branch: MAIN

Provide C11 <uchar.h>.
OK millert@.
Tested by naddy@ in a bulk and by matthieu@ in the new foot(1) port.
I originally wrote the code in 2022 at the prodding of espie@.
Using one improvement to a manual page from jmc@.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.