]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
_endian.h: Include sys/ctypes.h for visibility macros
authorWarner Losh <imp@FreeBSD.org>
Wed, 22 Mar 2023 02:25:58 +0000 (20:25 -0600)
committerWarner Losh <imp@FreeBSD.org>
Wed, 22 Mar 2023 02:25:58 +0000 (20:25 -0600)
commited52baf51bd142b5e32701842346452a7ebe37a5
tree4c06787aca4c70455efa6cc53867a4c99f42a1b0
parent1ad3cafcd34eaf65f002c0c5242374a61d4a9b54
_endian.h: Include sys/ctypes.h for visibility macros

BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN will be required by the
forthcoming POSIX Issue 8. In addition, they are provided in the BSD
compilation environments. However, depending on the order includes
happend, sys/cdefs.h may or may not be included when endian.h is
included. Include it here so we can safely test __BSD_VISIBLE.  Add
visibility when we're compiling in the future for issue 8, but since the
date number for issue 8 hasn't been fixed, use strictly greater than the
issue 7 date.of 200809.

This had the side effect of sometimes (in the traditional BSD
compliation environment)
 #if BYTE_ORDER == LITTLE_ENDIAN
and
 #if BYTE_ORDER == BIG_ENDIAN
both being true because none of these were defined. This fixes
that. It also fixes including it after <stdio.h> but not before.

PR: 269249
MFC After: 1d (build related)
Reviewed by: kib, emaste
Differential Revision: https://reviews.freebsd.org/D39176

Sponsored by: Netflix
sys/sys/_endian.h