svn commit: r1934390 - in apr/apr/trunk: . include

[email protected] Tue, 19 May 2026 11:51:45 -0000
Newsgroups gmane.comp.apache.apr.cvs
Message-ID <177919150560.773853.9752964679508641501@svn03-he-fi>
Author: ivan
Date: Tue May 19 11:51:45 2026
New Revision: 1934390

Log:
cmake: Set APR_IS_BIGENDIAN based on CMAKE_C_BYTE_ORDER.

Modified:
   apr/apr/trunk/CMakeLists.txt
   apr/apr/trunk/include/apr.hwc

Modified: apr/apr/trunk/CMakeLists.txt
==============================================================================
--- apr/apr/trunk/CMakeLists.txt	Tue May 19 09:40:02 2026	(r1934389)
+++ apr/apr/trunk/CMakeLists.txt	Tue May 19 11:51:45 2026	(r1934390)
@@ -120,6 +120,14 @@ if(APR_HAS_LDAP)
   set(LDAP_LIBRARIES wldap32)
 endif()
 
+if (CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN")
+  set(APR_IS_BIGENDIAN 1)
+elseif (CMAKE_C_BYTE_ORDER STREQUAL "LITTLE_ENDIAN")
+  set(APR_IS_BIGENDIAN 0)
+else ()
+  message(FATAL_ERROR "Endianness could not be determined.")
+endif ()
+
 if(APR_POOL_DEBUG)
   add_compile_definitions(APR_POOL_DEBUG=1)
 endif()

Modified: apr/apr/trunk/include/apr.hwc
==============================================================================
--- apr/apr/trunk/include/apr.hwc	Tue May 19 09:40:02 2026	(r1934389)
+++ apr/apr/trunk/include/apr.hwc	Tue May 19 11:51:45 2026	(r1934390)
@@ -393,9 +393,7 @@ typedef  apr_uint32_t            apr_uin
 typedef  apr_int32_t             apr_intptr_t;
 #endif
 
-/* Are we big endian? */
-/* XXX: Fatal assumption on Alpha platforms */
-#define APR_IS_BIGENDIAN        0
+#cmakedefine01 APR_IS_BIGENDIAN
 
 /* Mechanisms to properly type numeric literals */