]> wimlib.net Git - wimlib/commitdiff
Replace mempcpy() if not implemented
authorEric Biggers <ebiggers3@gmail.com>
Fri, 16 Aug 2013 23:46:28 +0000 (18:46 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 16 Aug 2013 23:46:28 +0000 (18:46 -0500)
configure.ac
include/wimlib/util.h
src/lookup_table.c
src/util.c

index 8d96cc370095a534e2bb24802990bae9204f3593..84c397a390c734ef91ffac793067c10358c808c5 100644 (file)
@@ -48,7 +48,7 @@ AC_PROG_CC
 AM_PROG_CC_C_O
 AC_CANONICAL_HOST
 
-AC_CHECK_FUNCS([utimensat lutimes utime flock])
+AC_CHECK_FUNCS([utimensat lutimes utime flock mempcpy])
 
 # Note: some of the following header checks are only to define the appropriate
 # HAVE_*_H macro so that the NTFS-3g headers don't get confused and try to skip
index 7b3e724a68ce677859eaa44ddf552cdf3ca1c6c0..7bc8359cf61f76f7e07a400c316fb150e61a5d9f 100644 (file)
@@ -90,6 +90,11 @@ wimlib_strdup(const char *str) _malloc_attribute;
 extern void *
 memdup(const void *mem, size_t size) _malloc_attribute;
 
+#ifndef HAVE_MEMPCPY
+extern void *
+mempcpy(void *dst, const void *src, size_t n);
+#endif
+
 /* util.c */
 extern void
 randomize_byte_array(u8 *p, size_t n);
index f5bd9aaa18802103eb35c4e291657432e264c739..7441932c169a06912fd31ec41a05c7628ef6f043 100644 (file)
@@ -918,13 +918,6 @@ wimlib_iterate_lookup_table(WIMStruct *wim, int flags,
        return for_lookup_table_entry(wim->lookup_table, do_iterate_lte, &ctx);
 }
 
-static int
-do_print_lookup_table_entry(struct wim_lookup_table_entry *lte, void *fp)
-{
-       print_lookup_table_entry(lte, (FILE*)fp);
-       return 0;
-}
-
 /* Given a SHA1 message digest, return the corresponding entry in the WIM's
  * lookup table, or NULL if there is none.  */
 struct wim_lookup_table_entry *
index 27e15acf3b3c20fcb492e935aaf7d45398021f6e..640f8b32ea1791dfd8db1f233cef4f584d971355 100644 (file)
@@ -576,3 +576,10 @@ void print_byte_field(const u8 field[], size_t len, FILE *out)
        while (len--)
                tfprintf(out, T("%02hhx"), *field++);
 }
+
+#ifndef HAVE_MEMPCPY
+void *mempcpy(void *dst, const void *src, size_t n)
+{
+       return memcpy(dst, src, n) + n;
+}
+#endif