|
417 | 417 | # include <features.h> // for __NATIVE_ASCII_F
|
418 | 418 | # endif
|
419 | 419 |
|
420 |
| -# ifdef __LITTLE_ENDIAN__ |
421 |
| -# if __LITTLE_ENDIAN__ |
422 |
| -# define _LIBCPP_LITTLE_ENDIAN |
423 |
| -# endif // __LITTLE_ENDIAN__ |
424 |
| -# endif // __LITTLE_ENDIAN__ |
425 |
| - |
426 |
| -# ifdef __BIG_ENDIAN__ |
427 |
| -# if __BIG_ENDIAN__ |
428 |
| -# define _LIBCPP_BIG_ENDIAN |
429 |
| -# endif // __BIG_ENDIAN__ |
430 |
| -# endif // __BIG_ENDIAN__ |
431 |
| - |
432 |
| -# ifdef __BYTE_ORDER__ |
433 |
| -# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
434 |
| -# define _LIBCPP_LITTLE_ENDIAN |
435 |
| -# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ |
436 |
| -# define _LIBCPP_BIG_ENDIAN |
437 |
| -# endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ |
438 |
| -# endif // __BYTE_ORDER__ |
| 420 | +# ifndef __BYTE_ORDER__ |
| 421 | +# error \ |
| 422 | + "Your compiler doesn't seem to define __BYTE_ORDER__, which is required by libc++ to know the endianness of your target platform" |
| 423 | +# endif |
439 | 424 |
|
440 |
| -# ifdef __FreeBSD__ |
441 |
| -# include <osreldate.h> |
442 |
| -# include <sys/endian.h> |
443 |
| -# if _BYTE_ORDER == _LITTLE_ENDIAN |
444 |
| -# define _LIBCPP_LITTLE_ENDIAN |
445 |
| -# else // _BYTE_ORDER == _LITTLE_ENDIAN |
446 |
| -# define _LIBCPP_BIG_ENDIAN |
447 |
| -# endif // _BYTE_ORDER == _LITTLE_ENDIAN |
448 |
| -# endif // __FreeBSD__ |
449 |
| - |
450 |
| -# if defined(__NetBSD__) || defined(__OpenBSD__) |
451 |
| -# include <sys/endian.h> |
452 |
| -# if _BYTE_ORDER == _LITTLE_ENDIAN |
453 |
| -# define _LIBCPP_LITTLE_ENDIAN |
454 |
| -# else // _BYTE_ORDER == _LITTLE_ENDIAN |
455 |
| -# define _LIBCPP_BIG_ENDIAN |
456 |
| -# endif // _BYTE_ORDER == _LITTLE_ENDIAN |
457 |
| -# endif // defined(__NetBSD__) || defined(__OpenBSD__) |
| 425 | +# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
| 426 | +# define _LIBCPP_LITTLE_ENDIAN |
| 427 | +# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ |
| 428 | +# define _LIBCPP_BIG_ENDIAN |
| 429 | +# endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ |
458 | 430 |
|
459 | 431 | # if defined(_WIN32)
|
460 | 432 | # define _LIBCPP_WIN32API
|
461 |
| -# define _LIBCPP_LITTLE_ENDIAN |
462 | 433 | # define _LIBCPP_SHORT_WCHAR 1
|
463 | 434 | // Both MinGW and native MSVC provide a "MSVC"-like environment
|
464 | 435 | # define _LIBCPP_MSVCRT_LIKE
|
|
531 | 502 | # define _LIBCPP_USING_DEV_RANDOM
|
532 | 503 | # endif
|
533 | 504 |
|
534 |
| -# if !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN) |
535 |
| -# include <endian.h> |
536 |
| -# if __BYTE_ORDER == __LITTLE_ENDIAN |
537 |
| -# define _LIBCPP_LITTLE_ENDIAN |
538 |
| -# elif __BYTE_ORDER == __BIG_ENDIAN |
539 |
| -# define _LIBCPP_BIG_ENDIAN |
540 |
| -# else // __BYTE_ORDER == __BIG_ENDIAN |
541 |
| -# error unable to determine endian |
542 |
| -# endif |
543 |
| -# endif // !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN) |
544 |
| - |
545 | 505 | # if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC)
|
546 | 506 | # define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
|
547 | 507 | # else
|
|
0 commit comments