diff options
Diffstat (limited to 'macros/texinfo/texinfo/tp/Texinfo/XS/gnulib/lib/xsize.h')
-rw-r--r-- | macros/texinfo/texinfo/tp/Texinfo/XS/gnulib/lib/xsize.h | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/macros/texinfo/texinfo/tp/Texinfo/XS/gnulib/lib/xsize.h b/macros/texinfo/texinfo/tp/Texinfo/XS/gnulib/lib/xsize.h index ecfd478dcd..b69bafc3a4 100644 --- a/macros/texinfo/texinfo/tp/Texinfo/XS/gnulib/lib/xsize.h +++ b/macros/texinfo/texinfo/tp/Texinfo/XS/gnulib/lib/xsize.h @@ -1,6 +1,6 @@ /* xsize.h -- Checked size_t computations. - Copyright (C) 2003, 2008-2019 Free Software Foundation, Inc. + Copyright (C) 2003, 2008-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,9 @@ # include <stdint.h> #endif +/* Get ATTRIBUTE_PURE. */ +#include "attribute.h" + #ifndef _GL_INLINE_HEADER_BEGIN #error "Please include config.h first." #endif @@ -56,10 +59,7 @@ _GL_INLINE_HEADER_BEGIN ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) /* Sum of two sizes, with overflow check. */ -XSIZE_INLINE size_t -#if __GNUC__ >= 3 -__attribute__ ((__pure__)) -#endif +XSIZE_INLINE size_t ATTRIBUTE_PURE xsum (size_t size1, size_t size2) { size_t sum = size1 + size2; @@ -67,30 +67,21 @@ xsum (size_t size1, size_t size2) } /* Sum of three sizes, with overflow check. */ -XSIZE_INLINE size_t -#if __GNUC__ >= 3 -__attribute__ ((__pure__)) -#endif +XSIZE_INLINE size_t ATTRIBUTE_PURE xsum3 (size_t size1, size_t size2, size_t size3) { return xsum (xsum (size1, size2), size3); } /* Sum of four sizes, with overflow check. */ -XSIZE_INLINE size_t -#if __GNUC__ >= 3 -__attribute__ ((__pure__)) -#endif +XSIZE_INLINE size_t ATTRIBUTE_PURE xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) { return xsum (xsum (xsum (size1, size2), size3), size4); } /* Maximum of two sizes, with overflow check. */ -XSIZE_INLINE size_t -#if __GNUC__ >= 3 -__attribute__ ((__pure__)) -#endif +XSIZE_INLINE size_t ATTRIBUTE_PURE xmax (size_t size1, size_t size2) { /* No explicit check is needed here, because for any n: |