gnulib: upgrade and install the mkstemp module.
gnulib 9e117ae955a5c6a0406140e62b76c3ef50e3bc2b. * lib/fcntl.in.h, lib/gettimeofday.c, lib/lstat.c, lib/mkstemp.c, lib/pathmax.h, lib/stat.c, lib/sys_stat.in.h, lib/sys_time.in.h, lib/tempname.c, lib/tempname.h, lib/time.in.h, lib/xsize.c, m4/extern-inline.m4, m4/fcntl-o.m4, m4/fcntl_h.m4, m4/gettimeofday.m4, m4/largefile.m4, m4/lstat.m4, m4/mkstemp.m4, m4/pathmax.m4, m4/stat.m4, m4/sys_stat_h.m4, m4/sys_time_h.m4, m4/tempname.m4, m4/time_h.m4: New files. * lib/xsize.h, m4/gnulib-cache.m4, m4/gnulib-comp.m4, m4/xsize.m4, lib/Makefile.am: Upgrade.
This commit is contained in:
parent
8ecf2ab1fd
commit
f38405002a
30 changed files with 3855 additions and 10 deletions
17
lib/xsize.h
17
lib/xsize.h
|
|
@ -27,6 +27,11 @@
|
|||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
_GL_INLINE_HEADER_BEGIN
|
||||
#ifndef XSIZE_INLINE
|
||||
# define XSIZE_INLINE _GL_INLINE
|
||||
#endif
|
||||
|
||||
/* The size of memory objects is often computed through expressions of
|
||||
type size_t. Example:
|
||||
void* p = malloc (header_size + n * element_size).
|
||||
|
|
@ -48,7 +53,7 @@
|
|||
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
|
||||
|
||||
/* Sum of two sizes, with overflow check. */
|
||||
static inline size_t
|
||||
XSIZE_INLINE size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
|
|
@ -59,7 +64,7 @@ xsum (size_t size1, size_t size2)
|
|||
}
|
||||
|
||||
/* Sum of three sizes, with overflow check. */
|
||||
static inline size_t
|
||||
XSIZE_INLINE size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
|
|
@ -69,7 +74,7 @@ xsum3 (size_t size1, size_t size2, size_t size3)
|
|||
}
|
||||
|
||||
/* Sum of four sizes, with overflow check. */
|
||||
static inline size_t
|
||||
XSIZE_INLINE size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
|
|
@ -79,7 +84,7 @@ xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
|
|||
}
|
||||
|
||||
/* Maximum of two sizes, with overflow check. */
|
||||
static inline size_t
|
||||
XSIZE_INLINE size_t
|
||||
#if __GNUC__ >= 3
|
||||
__attribute__ ((__pure__))
|
||||
#endif
|
||||
|
|
@ -92,7 +97,7 @@ xmax (size_t size1, size_t size2)
|
|||
|
||||
/* Multiplication of a count with an element size, with overflow check.
|
||||
The count must be >= 0 and the element size must be > 0.
|
||||
This is a macro, not an inline function, so that it works correctly even
|
||||
This is a macro, not a function, so that it works correctly even
|
||||
when N is of a wider type and N > SIZE_MAX. */
|
||||
#define xtimes(N, ELSIZE) \
|
||||
((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
|
||||
|
|
@ -104,4 +109,6 @@ xmax (size_t size1, size_t size2)
|
|||
#define size_in_bounds_p(SIZE) \
|
||||
((SIZE) != SIZE_MAX)
|
||||
|
||||
_GL_INLINE_HEADER_END
|
||||
|
||||
#endif /* _XSIZE_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue