Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/string libkern.h maps memcmp, memset and str...



details:   https://anonhg.NetBSD.org/src/rev/eda748a92897
branches:  trunk
changeset: 771087:eda748a92897
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Nov 08 16:52:11 2011 +0000

description:
libkern.h maps memcmp, memset and strcpy to the compiler builtins on
some platforms, so make sure to #undef them first.

diffstat:

 common/lib/libc/string/memcmp.c  |  5 +++--
 common/lib/libc/string/memset.c  |  6 +++---
 common/lib/libc/string/memset2.c |  4 ++--
 common/lib/libc/string/strcpy.c  |  6 ++----
 4 files changed, 10 insertions(+), 11 deletions(-)

diffs (99 lines):

diff -r 3c6f40069729 -r eda748a92897 common/lib/libc/string/memcmp.c
--- a/common/lib/libc/string/memcmp.c   Tue Nov 08 16:45:43 2011 +0000
+++ b/common/lib/libc/string/memcmp.c   Tue Nov 08 16:52:11 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memcmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $      */
+/*     $NetBSD: memcmp.c,v 1.3 2011/11/08 16:52:11 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)memcmp.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: memcmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
+__RCSID("$NetBSD: memcmp.c,v 1.3 2011/11/08 16:52:11 joerg Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -48,6 +48,7 @@
 #include <lib/libkern/libkern.h>
 #endif 
 
+#undef memcmp
 /*
  * Compare memory regions.
  */
diff -r 3c6f40069729 -r eda748a92897 common/lib/libc/string/memset.c
--- a/common/lib/libc/string/memset.c   Tue Nov 08 16:45:43 2011 +0000
+++ b/common/lib/libc/string/memset.c   Tue Nov 08 16:52:11 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memset.c,v 1.8 2009/03/18 12:25:06 tsutsui Exp $       */
+/*     $NetBSD: memset.c,v 1.9 2011/11/08 16:52:11 joerg Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)memset.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: memset.c,v 1.8 2009/03/18 12:25:06 tsutsui Exp $");
+__RCSID("$NetBSD: memset.c,v 1.9 2011/11/08 16:52:11 joerg Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -60,8 +60,8 @@
 
 #ifdef _FORTIFY_SOURCE
 #undef bzero
+#endif
 #undef memset
-#endif
 
 #ifndef __OPTIMIZE_SIZE__
 #ifdef BZERO
diff -r 3c6f40069729 -r eda748a92897 common/lib/libc/string/memset2.c
--- a/common/lib/libc/string/memset2.c  Tue Nov 08 16:45:43 2011 +0000
+++ b/common/lib/libc/string/memset2.c  Tue Nov 08 16:52:11 2011 +0000
@@ -49,11 +49,11 @@
 
 #ifdef _FORTIFY_SOURCE
 #undef bzero
+#endif
 #undef memset
-#endif
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: memset2.c,v 1.2 2009/12/14 00:39:01 matt Exp $");    
+__RCSID("$NetBSD: memset2.c,v 1.3 2011/11/08 16:52:11 joerg Exp $");    
 #endif /* LIBC_SCCS and not lint */
 
 /*
diff -r 3c6f40069729 -r eda748a92897 common/lib/libc/string/strcpy.c
--- a/common/lib/libc/string/strcpy.c   Tue Nov 08 16:45:43 2011 +0000
+++ b/common/lib/libc/string/strcpy.c   Tue Nov 08 16:52:11 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strcpy.c,v 1.2 2007/06/04 18:19:27 christos Exp $      */
+/*     $NetBSD: strcpy.c,v 1.3 2011/11/08 16:52:11 joerg Exp $ */
 
 /*
  * Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)strcpy.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: strcpy.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
+__RCSID("$NetBSD: strcpy.c,v 1.3 2011/11/08 16:52:11 joerg Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -45,9 +45,7 @@
 #include <lib/libkern/libkern.h>
 #endif
 
-#ifdef _FORTIFY_SOURCE
 #undef strcpy
-#endif
 
 char *
 strcpy(char *to, const char *from)



Home | Main Index | Thread Index | Old Index