This is an automated email from the ASF dual-hosted git repository.

wkaras pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new d0ecb3c23f Remove and reorganize HAS_*_ENDIAN_H, HAS_SYS_BYTEORDER_H 
and HAS_SYS_TYPES_H build vars (#10808)
d0ecb3c23f is described below

commit d0ecb3c23f2e9cae36998dce42ac38240b136ce2
Author: Phong Nguyen <[email protected]>
AuthorDate: Wed Jan 10 08:20:42 2024 -0800

    Remove and reorganize HAS_*_ENDIAN_H, HAS_SYS_BYTEORDER_H and 
HAS_SYS_TYPES_H build vars (#10808)
    
    * Remove and reorganize HAS_*_ENDIAN_H and HAS_SYS_BYTEORDER_H build vars
    
    * sys/types.h should always be on target platforms
---
 CMakeLists.txt                       |  5 -----
 include/tscore/ink_config.h.cmake.in |  5 -----
 include/tscore/ink_endian.h          | 13 +++----------
 include/tscore/ink_memory.h          |  2 --
 include/tscore/ink_platform.h        |  2 --
 5 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4646c54356..1608d2290d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -216,13 +216,9 @@ check_include_file(ifaddrs.h HAVE_IFADDRS_H)
 check_include_file(string.h HAVE_STRING_H)
 check_include_file(malloc.h HAVE_MALLOC_H)
 check_include_file(mcheck.h HAVE_MCHECK_H)
-check_include_file(machine/endian.h HAVE_MACHINE_ENDIAN_H)
-check_include_file(sys/byteorder.h HAVE_SYS_BYTEORDER_H)
 check_include_file(sys/disk.h HAVE_SYS_DISK_H)
 check_include_file(sys/disklabel.h HAVE_SYS_DISKLABEL_H)
-check_include_file(sys/endian.h HAVE_SYS_ENDIAN_H)
 check_include_file(sys/ioctl.h HAVE_SYS_IOCTL_H)
-check_include_file(sys/types.h HAVE_SYS_TYPES_H)
 check_include_file(sys/sockio.h HAVE_SYS_SOCKIO_H)
 check_include_file(sys/stat.h HAVE_SYS_STAT_H)
 check_include_file(sys/statfs.h HAVE_SYS_STATFS_H)
@@ -244,7 +240,6 @@ check_include_file(netdb.h HAVE_NETDB_H)
 check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
 check_include_file(arpa/nameser.h HAVE_ARPA_NAMESER_H)
 check_include_file(arpa/nameser_compat.h HAVE_ARPA_NAMESER_COMPAT_H)
-check_include_file(endian.h HAVE_ENDIAN_H)
 
 # Find libraries
 if(ENABLE_CRIPTS)
diff --git a/include/tscore/ink_config.h.cmake.in 
b/include/tscore/ink_config.h.cmake.in
index 18a9498649..45efd60d00 100644
--- a/include/tscore/ink_config.h.cmake.in
+++ b/include/tscore/ink_config.h.cmake.in
@@ -44,15 +44,11 @@
 #cmakedefine HAVE_LINUX_HDREG_H 1
 #cmakedefine HAVE_MALLOC_H 1
 #cmakedefine HAVE_MCHECK_H 1
-#cmakedefine HAVE_MACHINE_ENDIAN_H 1
-#cmakedefine HAVE_SYS_BYTEORDER_H 1
 #cmakedefine HAVE_SYS_DISK_H 1
 #cmakedefine HAVE_SYS_DISKLABEL_H 1
-#cmakedefine HAVE_SYS_ENDIAN_H 1
 #cmakedefine HAVE_SYS_CAPABILITY_H 1
 #cmakedefine HAVE_SYS_IOCTL_H 1
 #cmakedefine HAVE_SYS_PRCTL_H 1
-#cmakedefine HAVE_SYS_TYPES_H 1
 #cmakedefine HAVE_SYS_SOCKIO_H 1
 #cmakedefine HAVE_SYS_STAT_H 1
 #cmakedefine HAVE_SYS_STATFS_H 1
@@ -74,7 +70,6 @@
 #cmakedefine HAVE_ARPA_INET_H 1
 #cmakedefine HAVE_ARPA_NAMESER_H 1
 #cmakedefine HAVE_ARPA_NAMESER_COMPAT_H 1
-#cmakedefine HAVE_ENDIAN_H 1
 #cmakedefine HAVE_MALLOC_USABLE_SIZE 1
 #cmakedefine HAVE_MCHECK_PEDANTIC 1
 #cmakedefine HAVE_POSIX_FADVISE 1
diff --git a/include/tscore/ink_endian.h b/include/tscore/ink_endian.h
index 539c835412..83a91df4b8 100644
--- a/include/tscore/ink_endian.h
+++ b/include/tscore/ink_endian.h
@@ -25,16 +25,9 @@
 
 #include "tscore/ink_config.h"
 
-#ifdef HAVE_SYS_ENDIAN_H
-#include <sys/endian.h>
-#endif
-#ifdef HAVE_MACHINE_ENDIAN_H
-#include <machine/endian.h>
-#endif
-#ifdef HAVE_ENDIAN_H
-#include <endian.h>
-#endif
-#ifdef HAVE_SYS_BYTEORDER_H
+#include <sys/types.h>
+
+#if __has_include(<sys/byteorder.h>)
 #include <sys/byteorder.h>
 #endif
 
diff --git a/include/tscore/ink_memory.h b/include/tscore/ink_memory.h
index 7f9a0af994..9c3f651f72 100644
--- a/include/tscore/ink_memory.h
+++ b/include/tscore/ink_memory.h
@@ -34,9 +34,7 @@
 
 #include <unistd.h>
 
-#if HAVE_SYS_TYPES_H
 #include <sys/types.h>
-#endif
 
 #if HAVE_SYS_UIO_H
 #include <sys/uio.h>
diff --git a/include/tscore/ink_platform.h b/include/tscore/ink_platform.h
index aec2e6e97c..edc2f7f50f 100644
--- a/include/tscore/ink_platform.h
+++ b/include/tscore/ink_platform.h
@@ -63,9 +63,7 @@ struct ifafilt;
 #include <stdlib.h> // NOLINT(modernize-deprecated-headers)
 #include <ctype.h>  // NOLINT(modernize-deprecated-headers)
 #include <string.h> // NOLINT(modernize-deprecated-headers)
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
-#endif
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif

Reply via email to