]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Check for existence of mempcpy
authorUlf Hermann <ulf.hermann@qt.io>
Thu, 16 Feb 2017 09:10:30 +0000 (10:10 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 17 Feb 2017 09:45:39 +0000 (10:45 +0100)
If it doesn't exist, provide a definition based on memcpy.

Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
14 files changed:
ChangeLog
configure.ac
lib/ChangeLog
lib/system.h
lib/xstrndup.c
libasm/ChangeLog
libasm/disasm_str.c
libdwfl/ChangeLog
libdwfl/linux-kernel-modules.c
libebl/ChangeLog
libebl/eblmachineflagname.c
libebl/eblopenbackend.c
tests/ChangeLog
tests/elfstrmerge.c

index b50f79ee7002ef513a973d2b68fc9d405baab8e7..48185c36176c35bea0d4722ab404f0359c6afe31 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-02-15  Ulf Hermann  <ulf.hermann@qt.io>
+
+       * configure.ac: Add check for mempcpy.
+
 2017-02-09  Mark Wielaard  <mark@klomp.org>
 
        * configure.ac: Add check for adding -D_FORTIFY_SOURCE=2 to CFLAGS.
index 46055f26291e1c115473ca92cf88f52848965a57..3c35dac5dfe5a7741d1c7c865fda7ab4c3fe5436 100644 (file)
@@ -285,6 +285,9 @@ AC_CHECK_DECLS([memrchr, rawmemchr],[],[],
                [#define _GNU_SOURCE
                 #include <string.h>])
 AC_CHECK_DECLS([powerof2],[],[],[#include <sys/param.h>])
+AC_CHECK_DECLS([mempcpy],[],[],
+               [#define _GNU_SOURCE
+                #include <string.h>])
 
 AC_CHECK_LIB([stdc++], [__cxa_demangle], [dnl
 AC_DEFINE([USE_DEMANGLE], [1], [Defined if demangling is enabled])])
index 6578ddbaef0da442cdbcdf017a3f1aba4f52ad5f..fd63e0390a7961edfe40c8fd07fd8f905c801bb8 100644 (file)
@@ -1,3 +1,8 @@
+2017-02-15  Ulf Hermann  <ulf.hermann@qt.io>
+
+       * system.h: Provide mempcpy if it doesn't exist.
+       * xstrndup.c: Include system.h.
+
 2017-02-15  Ulf Hermann  <ulf.hermann@qt.io>
 
        * crc32_file.c: Use _SC_PAGESIZE rather than _SC_PAGE_SIZE.
index dde7c4a22ee6f03feb84963bab7a073f4b879206..429b0c33267fbb27d3b68ed232c1a8c0ce4a6351 100644 (file)
 #define powerof2(x) (((x) & ((x) - 1)) == 0)
 #endif
 
+#if !HAVE_DECL_MEMPCPY
+#define mempcpy(dest, src, n) \
+    ((void *) ((char *) memcpy (dest, src, n) + (size_t) n))
+#endif
+
 /* A special gettext function we use if the strings are too short.  */
 #define sgettext(Str) \
   ({ const char *__res = strrchr (gettext (Str), '|');                       \
index d43e3b9e1a66e1e4a28023fa8bca8d56294e6888..a257aa9a0445b49d0aacb79a838ebf47b35e1462 100644 (file)
@@ -33,7 +33,7 @@
 #include <stdint.h>
 #include <string.h>
 #include "libeu.h"
-
+#include "system.h"
 
 /* Return a newly allocated copy of STRING.  */
 char *
index fe06007e98d4ca75c6f0ac789dfc096b20f578aa..26fc5a951a87241e301b0a6fde552b08c06874d2 100644 (file)
@@ -1,3 +1,7 @@
+2017-02-15  Ulf Hermann  <ulf.hermann@qt.io>
+
+       * disasm_str.c: Include system.h.
+
 2015-10-11  Akihiko Odaki  <akihiko.odaki.4i@stu.hosei.ac.jp>
 
        * asm_align.c: Remove sys/param.h include.
index 5b0bb299ec070bf9416547378af7e4b138d32642..c14e6d5b6eb02a610f969ca3ec2b74a8038b2511 100644 (file)
@@ -31,7 +31,7 @@
 #endif
 
 #include <string.h>
-
+#include <system.h>
 #include "libasmP.h"
 
 
index 52466cc35fcee288e5474ca0559910c846a9c721..4c9f4f6acb3d780bb2e8c1488470b7b9b86beedf 100644 (file)
@@ -1,3 +1,7 @@
+2017-02-15  Ulf Hermann  <ulf.hermann@qt.io>
+
+       * linux-kernel-modules.c: Include system.h.
+
 2017-02-15  Ulf Hermann  <ulf.hermann@qt.io>
 
        * linux-kernel-modules.c: Use sysconf(_SC_PAGESIZE) to get page size.
index a7ac19d2627e1e037d5409875be1a7d5cf1e2c9d..7345e760f2ce584812dba3bc7aa7a44fb53fdbb1 100644 (file)
@@ -34,6 +34,7 @@
 #endif
 
 #include <config.h>
+#include <system.h>
 
 #include "libdwflP.h"
 #include <inttypes.h>
index 0560c6accfd23303dab81743457a27574ec9db46..719d08d0232ce3373cb4e4382318bbbbe5bd500b 100644 (file)
@@ -1,3 +1,8 @@
+2017-02-15  Ulf Hermann  <ulf.hermann@qt.io>
+
+       * eblmachineflagname.c: Include system.h.
+       * eblopenbackend.c: Likewise.
+
 2016-07-08  Mark Wielaard  <mjw@redhat.com>
 
        * Makefile.am (gen_SOURCES): Remove eblstrtab.c.
index 6079a613f0d0989c0c130751cb6d45a7de17bb3b..5f4407765f5f956fb1e274bb5b10104f3b7e65bd 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <system.h>
 #include <libeblP.h>
 
 
index aa75b9570beed291011bea352bc87d1f9f7115dc..f3a65cfa2e9da8a7e3c75c839061dee6503f8c74 100644 (file)
@@ -39,6 +39,7 @@
 #include <string.h>
 #include <stdio.h>
 
+#include <system.h>
 #include <libeblP.h>
 
 
index bca47be15c1a9d1f1ea3d0f8a684ea88afdf345a..cc6a19bf1351ca86d95e48cf2e7f0daa69033e10 100644 (file)
@@ -1,3 +1,7 @@
+2017-02-15  Ulf Hermann  <ulf.hermann@qt.io>
+
+       * elfstrmerge.c: Include system.h.
+
 2017-02-09  Ulf Hermann  <ulf.hermann@qt.io>
 
        * backtrace.c: Add an option to allow unknown symbols in the trace
index c2c3fb97228ba910a3a0b8b5403d84e824e51b56..8d5b53cb2bdc6144c96851e5ef6b18e9273d9b3b 100644 (file)
@@ -29,6 +29,7 @@
 #include <inttypes.h>
 #include <unistd.h>
 
+#include <system.h>
 #include <gelf.h>
 #include ELFUTILS_HEADER(dwelf)
 #include "elf-knowledge.h"