mirror of https://git.tukaani.org/xz.git
Remove support for pre-C89 libc versions that lack memcpy,
memmove, and memset.
This commit is contained in:
parent
b09464bf9a
commit
ed6664146f
|
@ -444,7 +444,7 @@ gl_GETOPT
|
||||||
|
|
||||||
# Functions that are not mandatory i.e. we have alternatives for them
|
# Functions that are not mandatory i.e. we have alternatives for them
|
||||||
# or we can just drop some functionality:
|
# or we can just drop some functionality:
|
||||||
AC_CHECK_FUNCS([memcpy memmove memset futimes futimesat])
|
AC_CHECK_FUNCS([futimes futimesat])
|
||||||
|
|
||||||
# Check how to find out the amount of physical memory in the system. The
|
# Check how to find out the amount of physical memory in the system. The
|
||||||
# lzma command line tool uses this to automatically limits its memory usage.
|
# lzma command line tool uses this to automatically limits its memory usage.
|
||||||
|
|
|
@ -132,19 +132,8 @@ typedef unsigned char _Bool;
|
||||||
// Macros //
|
// Macros //
|
||||||
////////////
|
////////////
|
||||||
|
|
||||||
#ifndef HAVE_MEMCPY
|
#undef memzero
|
||||||
# define memcpy(dest, src, n) bcopy(src, dest, n)
|
#define memzero(s, n) memset(s, 0, n)
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_MEMMOVE
|
|
||||||
# define memmove(dest, src, n) bcopy(src, dest, n)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_MEMSET
|
|
||||||
# define memzero(s, n) memset(s, 0, n)
|
|
||||||
#else
|
|
||||||
# define memzero(s, n) bzero(s, n)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MIN
|
#ifndef MIN
|
||||||
# define MIN(x, y) ((x) < (y) ? (x) : (y))
|
# define MIN(x, y) ((x) < (y) ? (x) : (y))
|
||||||
|
|
|
@ -35,7 +35,7 @@ lzma_alloc(size_t size, lzma_allocator *allocator)
|
||||||
else
|
else
|
||||||
ptr = malloc(size);
|
ptr = malloc(size);
|
||||||
|
|
||||||
#if !defined(NDEBUG) && defined(HAVE_MEMSET)
|
#ifndef NDEBUG
|
||||||
// This helps to catch some stupid mistakes, but also hides them from
|
// This helps to catch some stupid mistakes, but also hides them from
|
||||||
// Valgrind. Uncomment when useful.
|
// Valgrind. Uncomment when useful.
|
||||||
// if (ptr != NULL)
|
// if (ptr != NULL)
|
||||||
|
|
Loading…
Reference in New Issue