aboutsummaryrefslogtreecommitdiff
path: root/string/bits/string2.h
diff options
context:
space:
mode:
Diffstat (limited to 'string/bits/string2.h')
-rw-r--r--string/bits/string2.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/string/bits/string2.h b/string/bits/string2.h
index da168facc2..a02b0558f1 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -178,10 +178,12 @@ __STRING2_COPY_TYPE (8);
\
__s; })
# else
-# define memset(s, c, n) \
+# if ! __GNUC_PREREQ (3, 0)
+# define memset(s, c, n) \
(__extension__ (__builtin_constant_p (c) && (c) == '\0' \
? ({ void *__s = (s); __bzero (__s, n); __s; }) \
: memset (s, c, n)))
+# endif
# endif
/* GCC optimizes memset(s, 0, n) but not bzero(s, n).