You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2024/03/18 10:21:43 UTC

svn commit: r1916386 - in /apr/apr/branches/1.8.x: ./ include/apr_general.h

Author: ylavic
Date: Mon Mar 18 10:21:43 2024
New Revision: 1916386

URL: http://svn.apache.org/viewvc?rev=1916386&view=rev
Log:
apr_general: Follow up to r1916337: Work around some broken compilers.

Older gcc (e.g. 8.5.0 per RĂ¼diger) want two #ifs for:

#if defined(__has_builtin) && __has_builtin(__builtin_offsetof)

So be it..


Merges r1916385 from ^/apr/apr/trunk

Modified:
    apr/apr/branches/1.8.x/   (props changed)
    apr/apr/branches/1.8.x/include/apr_general.h

Propchange: apr/apr/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r1916385

Modified: apr/apr/branches/1.8.x/include/apr_general.h
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.8.x/include/apr_general.h?rev=1916386&r1=1916385&r2=1916386&view=diff
==============================================================================
--- apr/apr/branches/1.8.x/include/apr_general.h (original)
+++ apr/apr/branches/1.8.x/include/apr_general.h Mon Mar 18 10:21:43 2024
@@ -103,13 +103,18 @@ typedef int               apr_signum_t;
  * @param field  data field within the structure
  * @return offset
  */
-#if defined(__has_builtin) && __has_builtin(__builtin_offsetof)
+#if defined(__has_builtin)
+#if __has_builtin(__builtin_offsetof)
 #define APR_OFFSETOF(s_type,field) __builtin_offsetof(s_type,field)
-#elif defined(offsetof) && !defined(__cplusplus)
+#endif
+#endif /* __has_builtin */
+#ifndef APR_OFFSETOF
+#if defined(offsetof) && !defined(__cplusplus)
 #define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
 #else
 #define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field)
 #endif
+#endif /* ndef APR_OFFSETOF */
 
 #ifndef DOXYGEN