aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
authorPaul Eggert2011-07-04 22:27:49 -0700
committerPaul Eggert2011-07-04 22:27:49 -0700
commit9cfdb3ec08672f13088ebd133bbc794c04a66b05 (patch)
tree0e0b851de11b990831c7a0fc39ff97f00edfad93 /src/sysdep.c
parent6089c5670b18a02fc2caca3e665d2bb7799dc4c8 (diff)
downloademacs-9cfdb3ec08672f13088ebd133bbc794c04a66b05.tar.gz
emacs-9cfdb3ec08672f13088ebd133bbc794c04a66b05.zip
[ChangeLog]
Assume support for memcmp, memcpy, memmove, memset. This simplifies the code a bit. All current platforms have these, as they are required for C89. If this turns into a problem we can add the gnulib modules for these (a 1-line change to Makefile.in). * configure.in: Don't check for memcmp, memcpy, memmove, memset. [lib-src/ChangeLog] Assume support for memcmp, memcpy, memmove, memset. * etags.c (absolute_filename): Assume memmove exists. [src/ChangeLog] Assume support for memcmp, memcpy, memmove, memset. * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset): * regex.c (memcmp, memcpy): Remove; we assume C89 now. * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now. (__malloc_safe_bcopy): Remove; no longer needed.
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 8b6939b91fe..f157baf3e76 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2216,59 +2216,6 @@ rmdir (char *dpath)
2216#endif /* !HAVE_RMDIR */ 2216#endif /* !HAVE_RMDIR */
2217 2217
2218 2218
2219#ifndef HAVE_MEMSET
2220void *
2221memset (void *b, int n, size_t length)
2222{
2223 unsigned char *p = b;
2224 while (length-- > 0)
2225 *p++ = n;
2226 return b;
2227}
2228#endif /* !HAVE_MEMSET */
2229
2230#ifndef HAVE_MEMCPY
2231void *
2232memcpy (void *b1, void *b2, size_t length)
2233{
2234 unsigned char *p1 = b1, *p2 = b2;
2235 while (length-- > 0)
2236 *p1++ = *p2++;
2237 return b1;
2238}
2239#endif /* !HAVE_MEMCPY */
2240
2241#ifndef HAVE_MEMMOVE
2242void *
2243memmove (void *b1, void *b2, size_t length)
2244{
2245 unsigned char *p1 = b1, *p2 = b2;
2246 if (p1 < p2 || p1 >= p2 + length)
2247 while (length-- > 0)
2248 *p1++ = *p2++;
2249 else
2250 {
2251 p1 += length;
2252 p2 += length;
2253 while (length-- > 0)
2254 *--p1 = *--p2;
2255 }
2256 return b1;
2257}
2258#endif /* !HAVE_MEMCPY */
2259
2260#ifndef HAVE_MEMCMP
2261int
2262memcmp (void *b1, void *b2, size_t length)
2263{
2264 unsigned char *p1 = b1, *p2 = b2;
2265 while (length-- > 0)
2266 if (*p1++ != *p2++)
2267 return p1[-1] < p2[-1] ? -1 : 1;
2268 return 0;
2269}
2270#endif /* !HAVE_MEMCMP */
2271
2272#ifndef HAVE_STRSIGNAL 2219#ifndef HAVE_STRSIGNAL
2273char * 2220char *
2274strsignal (int code) 2221strsignal (int code)