[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] Symbol collision
From: |
Simon Josefsson |
Subject: |
Re: [Bug-gnulib] Symbol collision |
Date: |
Fri, 11 Jul 2003 09:26:24 +0200 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
Paul Eggert <address@hidden> writes:
> Simon Josefsson <address@hidden> writes:
>
>> Btw (to everyone), any progress on adding the mempcpy module?
>
> Sorry, what project or request was that? A search in the bug-gnulib
> archives didn't find it.
My fault! I sent the request to address@hidden Sorry for my
implied accusation.
Btw, argp now compiles on many platforms. I have sent patches to
libc-alpha, will send m4/module updates once the patches are
integrated.
ChangeLog:
2003-06-12 Simon Josefsson <address@hidden>
* MODULES.html.sh (Extra functions based on ANSI C 89): Add mempcpy.
* modules/mempcpy: New file.
lib/ChangeLog:
2003-06-12 Simon Josefsson <address@hidden>
* mempcpy.h, mempcpy.c: New file.
m4/ChangeLog:
2003-06-12 Simon Josefsson <address@hidden>
* mempcpy.m4: New file.
Index: MODULES.html.sh
===================================================================
RCS file: /cvsroot/gnulib/gnulib/MODULES.html.sh,v
retrieving revision 1.24
diff -u -p -r1.24 MODULES.html.sh
--- MODULES.html.sh 25 Jun 2003 20:54:22 -0000 1.24
+++ MODULES.html.sh 11 Jul 2003 07:30:44 -0000
@@ -1503,6 +1503,7 @@ func_all_modules ()
func_begin_table
func_module bcopy
func_module memrchr
+ func_module mempcpy
func_module stpcpy
func_module stpncpy
func_module strcase
Index: lib/mempcpy.c
===================================================================
RCS file: lib/mempcpy.c
diff -N lib/mempcpy.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lib/mempcpy.c 11 Jul 2003 07:30:45 -0000
@@ -0,0 +1,27 @@
+/* Copy memory area and return pointer after last written byte.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Specification. */
+#include "mempcpy.h"
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+void *
+mempcpy (void *dest, const void *src, size_t n)
+{
+ return (char *) memcpy (dest, src, n) + n;
+}
Index: lib/mempcpy.h
===================================================================
RCS file: lib/mempcpy.h
diff -N lib/mempcpy.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lib/mempcpy.h 11 Jul 2003 07:30:45 -0000
@@ -0,0 +1,32 @@
+/* Copy memory area and return pointer after last written byte.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#if HAVE_MEMPCPY
+
+/* Get mempcpy() declaration. */
+#include <string.h>
+
+#else
+
+/* Get size_t */
+#include <string.h>
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+ last written byte. */
+extern void *mempcpy (void *dest, const void *src, size_t n);
+
+#endif
Index: m4/mempcpy.m4
===================================================================
RCS file: m4/mempcpy.m4
diff -N m4/mempcpy.m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m4/mempcpy.m4 11 Jul 2003 07:30:45 -0000
@@ -0,0 +1,23 @@
+# mempcpy.m4 serial 1
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([gl_FUNC_MEMPCPY],
+[
+ dnl Persuade glibc <string.h> to declare mempcpy().
+ AC_REQUIRE([AC_GNU_SOURCE])
+
+ AC_REPLACE_FUNCS(mempcpy)
+ if test $ac_cv_func_mempcpy = no; then
+ gl_PREREQ_MEMPCPY
+ fi
+])
+
+# Prerequisites of lib/mempcpy.c.
+AC_DEFUN([gl_PREREQ_MEMPCPY], [
+ AC_CHECK_HEADERS_ONCE(string.h)
+])
Index: modules/mempcpy
===================================================================
RCS file: modules/mempcpy
diff -N modules/mempcpy
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ modules/mempcpy 11 Jul 2003 07:30:45 -0000
@@ -0,0 +1,22 @@
+Description:
+mempcpy() function: copy memory area, return point after last written byte.
+
+Files:
+lib/mempcpy.h
+lib/mempcpy.c
+m4/mempcpy.m4
+
+Depends-on:
+memcpy
+
+configure.ac:
+gl_FUNC_MEMPCPY
+
+Makefile.am:
+lib_SOURCES += mempcpy.h
+
+Include:
+"mempcpy.h"
+
+Maintainer:
+FSF