summaryrefslogtreecommitdiffstats
path: root/gl/xsize.h
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-11-06 08:24:23 (GMT)
committerGitHub <noreply@github.com>2024-11-06 08:24:23 (GMT)
commit9b4df9e50837cc837e113053ba12ee6967d5e6c2 (patch)
treebf989e771579f835bcb49c074637a8e224bcecbc /gl/xsize.h
parent94150ae347beb25ac369d5773834ceef7f3736d3 (diff)
parent5be04ec2ceb1df77afbca4fcbf9e92a712612d6f (diff)
downloadmonitoring-plugins-9b4df9e50837cc837e113053ba12ee6967d5e6c2.tar.gz
Merge pull request #2037 from RincewindsHat/update/gnulib-1.0
Sync with the latest Gnulib code (d4ec02b3cc) (gnulib v1.0)
Diffstat (limited to 'gl/xsize.h')
-rw-r--r--gl/xsize.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/gl/xsize.h b/gl/xsize.h
index 1ec78e7..619c0ed 100644
--- a/gl/xsize.h
+++ b/gl/xsize.h
@@ -1,6 +1,6 @@
1/* xsize.h -- Checked size_t computations. 1/* xsize.h -- Checked size_t computations.
2 2
3 Copyright (C) 2003, 2008-2023 Free Software Foundation, Inc. 3 Copyright (C) 2003, 2008-2024 Free Software Foundation, Inc.
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
@@ -18,6 +18,11 @@
18#ifndef _XSIZE_H 18#ifndef _XSIZE_H
19#define _XSIZE_H 19#define _XSIZE_H
20 20
21/* This file uses _GL_INLINE_HEADER_BEGIN, _GL_INLINE, HAVE_STDINT_H. */
22#if !_GL_CONFIG_H_INCLUDED
23 #error "Please include config.h first."
24#endif
25
21/* Get size_t. */ 26/* Get size_t. */
22#include <stddef.h> 27#include <stddef.h>
23 28
@@ -30,14 +35,16 @@
30/* Get ATTRIBUTE_PURE. */ 35/* Get ATTRIBUTE_PURE. */
31#include "attribute.h" 36#include "attribute.h"
32 37
33#ifndef _GL_INLINE_HEADER_BEGIN
34 #error "Please include config.h first."
35#endif
36_GL_INLINE_HEADER_BEGIN 38_GL_INLINE_HEADER_BEGIN
37#ifndef XSIZE_INLINE 39#ifndef XSIZE_INLINE
38# define XSIZE_INLINE _GL_INLINE 40# define XSIZE_INLINE _GL_INLINE
39#endif 41#endif
40 42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47
41/* The size of memory objects is often computed through expressions of 48/* The size of memory objects is often computed through expressions of
42 type size_t. Example: 49 type size_t. Example:
43 void* p = malloc (header_size + n * element_size). 50 void* p = malloc (header_size + n * element_size).
@@ -103,6 +110,11 @@ xmax (size_t size1, size_t size2)
103#define size_in_bounds_p(SIZE) \ 110#define size_in_bounds_p(SIZE) \
104 ((SIZE) != SIZE_MAX) 111 ((SIZE) != SIZE_MAX)
105 112
113
114#ifdef __cplusplus
115}
116#endif
117
106_GL_INLINE_HEADER_END 118_GL_INLINE_HEADER_END
107 119
108#endif /* _XSIZE_H */ 120#endif /* _XSIZE_H */