From 5be04ec2ceb1df77afbca4fcbf9e92a712612d6f Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:27:12 +0100 Subject: Sync with the latest Gnulib code (d4ec02b3cc) --- gl/xsize.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'gl/xsize.h') diff --git a/gl/xsize.h b/gl/xsize.h index 1ec78e77..619c0edc 100644 --- a/gl/xsize.h +++ b/gl/xsize.h @@ -1,6 +1,6 @@ /* xsize.h -- Checked size_t computations. - Copyright (C) 2003, 2008-2023 Free Software Foundation, Inc. + Copyright (C) 2003, 2008-2024 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -18,6 +18,11 @@ #ifndef _XSIZE_H #define _XSIZE_H +/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, HAVE_STDINT_H. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Get size_t. */ #include @@ -30,14 +35,16 @@ /* Get ATTRIBUTE_PURE. */ #include "attribute.h" -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif _GL_INLINE_HEADER_BEGIN #ifndef XSIZE_INLINE # define XSIZE_INLINE _GL_INLINE #endif +#ifdef __cplusplus +extern "C" { +#endif + + /* The size of memory objects is often computed through expressions of type size_t. Example: void* p = malloc (header_size + n * element_size). @@ -103,6 +110,11 @@ xmax (size_t size1, size_t size2) #define size_in_bounds_p(SIZE) \ ((SIZE) != SIZE_MAX) + +#ifdef __cplusplus +} +#endif + _GL_INLINE_HEADER_END #endif /* _XSIZE_H */ -- cgit v1.2.3-74-g34f1