Re: [PATCH rdma-core] verbs: Fix C++ compilation break

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 09, 2017 at 01:11:01PM -0600, Jason Gunthorpe wrote:
> On Mon, Oct 09, 2017 at 10:05:19PM +0300, Leon Romanovsky wrote:
>
> > It means that your glibc is new enough.
> > On some systems, the stdint.h contains the following ifdef to protect UINTPTR_MAX
> > "#if !defined __cplusplus || defined __STDC_LIMIT_MACROS"
>
> Ah, that old thing. __STDC_LIMIT_MACROS is removed from the latest
> standards, and IIRC, including cstdint isn't even enough to reliably
> get the macros under the old standards.
>
> The commit comment should describe the problem in these terms..
>
> So this is the best fix:
>
> > > #ifdef __cplusplus
> > > #include <limits>
> > > #define __VERBS_ABI_IS_EXTENDED ((void *)std::numeric_limits<uintptr_t>::max())
> > > #else
> > > #define __VERBS_ABI_IS_EXTENDED ((void *)UINTPTR_MAX)
> > > #endif
>
> Because numeric_limits is never subject to __STDC_LIMIT_MACROS

Thanks, I'll test it on that system and resend.

>
> Jason

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux