Skip to content

Commit

Permalink
apr_general: Follow up to r1916337: Work around some broken compilers.
Browse files Browse the repository at this point in the history
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


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1916386 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ylavic committed Mar 18, 2024
1 parent 2690927 commit b97ebdf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions include/apr_general.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b97ebdf

Please sign in to comment.