Redo libc++ customizations

* Remove osreldate include because _LIBCPP_HAS_NO_GETS has disappeared
* Instead, add direct major __FreeBSD__ check for using ::gets declaration
* Mark EINTEGRITY values as FreeBSD customization
* Reformat _LIBCPP_TYPE_VISIBILITY_DEFAULT customization

PR:		276104
MFC after:	1 month
This commit is contained in:
Dimitry Andric 2024-01-14 14:20:42 +01:00
parent 297eecfb02
commit 46c59ea9b6
3 changed files with 5 additions and 9 deletions

View file

@ -486,10 +486,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
# include <features.h> // for __NATIVE_ASCII_F
# endif
# ifdef __FreeBSD__
# include <osreldate.h> // for __FreeBSD_version
# endif
# ifndef __BYTE_ORDER__
# error \
"Your compiler doesn't seem to define __BYTE_ORDER__, which is required by libc++ to know the endianness of your target platform"
@ -734,8 +730,8 @@ typedef __char32_t char32_t;
# define _LIBCPP_TEMPLATE_VIS
# endif
# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__) \
&& _LIBCPP_CLANG_VER >= 1500 // FreeBSD customization
# if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__) && \
_LIBCPP_CLANG_VER >= 1500 // FreeBSD customization
# define _LIBCPP_TYPE_VISIBILITY_DEFAULT __attribute__((__type_visibility__("default")))
# else
# define _LIBCPP_TYPE_VISIBILITY_DEFAULT

View file

@ -45,7 +45,7 @@ enum class errc
identifier_removed, // EIDRM
illegal_byte_sequence, // EILSEQ
inappropriate_io_control_operation, // ENOTTY
integrity_check_failed, // EINTEGRITY
integrity_check_failed, // EINTEGRITY // FreeBSD customization
interrupted, // EINTR
invalid_argument, // EINVAL
invalid_seek, // ESPIPE
@ -143,7 +143,7 @@ _LIBCPP_DECLARE_STRONG_ENUM(errc){
illegal_byte_sequence = EILSEQ,
inappropriate_io_control_operation = ENOTTY,
#ifdef EINTEGRITY
integrity_check_failed = EINTEGRITY,
integrity_check_failed = EINTEGRITY, // FreeBSD customization
#endif
interrupted = EINTR,
invalid_argument = EINVAL,

View file

@ -159,7 +159,7 @@ using ::tmpfile _LIBCPP_USING_IF_EXISTS;
using ::tmpnam _LIBCPP_USING_IF_EXISTS;
using ::getchar _LIBCPP_USING_IF_EXISTS;
#if _LIBCPP_STD_VER <= 11
#if _LIBCPP_STD_VER <= 11 && !(defined(__FreeBSD__) && __FreeBSD__ >= 13) // FreeBSD customization
using ::gets _LIBCPP_USING_IF_EXISTS;
#endif
using ::scanf _LIBCPP_USING_IF_EXISTS;