code cleanup: header detection with has_include

This commit is contained in:
Yury Popov
2022-11-27 14:54:48 +03:00
parent 6a8b6ae723
commit c8a21a5463
6 changed files with 6 additions and 7 deletions
+2 -2
View File
@@ -20,10 +20,10 @@
#define ENDIAN_H_COMPAT_SHIM
#pragma once
#if defined(HAVE_ENDIAN_H)
#if __has_include_next(<endian.h>)
# pragma GCC system_header // Silence "warning: #include_next is a GCC extension"
# include_next <endian.h>
#elif defined(HAVE_SYS_ENDIAN_H)
#elif __has_include(<sys/endian.h>)
# include <sys/endian.h>
# if !defined(be16toh)
# define be16toh(x) betoh16(x)