Re: svn commit: r1916337 - /apr/apr/trunk/include/apr_general.h

Yann Ylavic <[email protected]>
Newsgroups gmane.comp.apache.apr.devel
Message-ID <CAKQ1sVPNfvFaF_mYUpXf+Vpg_-s2Mo1bET27dg6LczTF1oWr-g@mail.gmail.com>
On Mon, Mar 18, 2024 at 10:00 AM Ruediger Pluem <[email protected]> wrote:
>
> On 3/15/24 2:35 PM, [email protected] wrote:
> >
> > -#if defined(offsetof) && !defined(__cplusplus)
> > +#if defined(__has_builtin) && __has_builtin(__builtin_offsetof)
>
> This causes an
>
> ./include/apr_general.h:109:45: error: missing binary operator before token "("
>
> with gcc 8.5.0 for me. Following https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fbuiltin.html
> and changing it to
>
> Index: include/apr_general.h
> ===================================================================
> --- include/apr_general.h       (revision 1916382)
> +++ include/apr_general.h       (working copy)
> @@ -106,13 +106,18 @@
>   * @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
> +#if !defined(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
>
>
> Looks like to me that __has_builtin does not like to be used within an '&&' operation for whatever reason.

oO well, ok: r1916385 (plus backports to 1.[78])

Thanks;
Yann.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.