removed use of have_memmv.c and HAVE_MEMMOVE, prep for version 2.15.1.2

Removed use of HAVE_MEMMOVE as well have_memmv.c.  Removed the
building and including of have_memmv.h.  Removed the memmove()
function in blkcpy.c, used when HAVE_MEMMOVE was NOT defined.
The libc memmove(3) function as defined by <string.h> is now
required to compile calc because the replacement code in
blkcpy.c q was problematic, especially when regions overlap.
The HAVE_MEMMOVE make symbol was removed from Makefile.config.
Thanks to GitHub user @skeeto for reporting this problem.
This commit is contained in:
Landon Curt Noll
2025-08-13 12:37:22 -07:00
parent 8542143463
commit d9245844aa
10 changed files with 27 additions and 282 deletions

15
alloc.h
View File

@@ -1,7 +1,7 @@
/*
* alloc - storage allocation and storage debug macros
*
* Copyright (C) 1999-2007,2014 David I. Bell
* Copyright (C) 1999-2007,2014,2025 David I. Bell
*
* Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License
@@ -32,13 +32,11 @@
# include "decl.h"
# include "have_newstr.h"
# include "have_string.h"
# include "have_memmv.h"
# include "have_const.h"
#else
# include <calc/decl.h>
# include <calc/have_newstr.h>
# include <calc/have_string.h>
# include <calc/have_memmv.h>
# include <calc/have_const.h>
#endif
@@ -79,15 +77,4 @@ E_FUNC int strcmp();
#define strchr(s, c) index(s, c)
#endif /* HAVE_NEWSTR */
#if !defined(HAVE_MEMMOVE)
# undef MEMMOVE_SIZE_T
#if defined(FORCE_STDC) || \
(defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
# define MEMMOVE_SIZE_T size_t
# else
# define MEMMOVE_SIZE_T long
# endif
E_FUNC void *memmove(void *s1, CONST void *s2, MEMMOVE_SIZE_T n);
#endif
#endif /* !INCLUDE_ALLOC_H */