This is the mail archive of the
cygwin-developers@sourceware.cygnus.com
mailing list for the Cygwin project.
use of __builtin_memset
- To: cygwin-developers at sourceware dot cygnus dot com
- Subject: use of __builtin_memset
- From: Mumit Khan <khan at NanoTech dot Wisc dot EDU>
- Date: Fri, 7 Jan 2000 13:08:27 -0600 (CST)
I see that the use of __builtin_memset has been turned on in the
last winsup snapshot, which breaks building under gcc-2.95.x, which
doesn't really support it. Interestingly enough, gcc-2.95.2 seems to
have __builtin_memset in its code, but c++ front-end rejects the code
unless properly prototyped.
A good way to handle this is to use autoconf.
Here's how you can do this in configure.in:
# Test for builtin mem* functions.
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#include <string.h>
void foo (char *s, int c, size_t n)
{
__builtin_memset(s, c, n);
}
], [ ],
use_builtin_memset=yes, use_builtin_memset=no)
if test "$use_builtin_memset" = "yes"; then
AC_DEFINE(WINSUP_HAS_BUILTIN_MEMSET)
fi
AC_LANG_RESTORE
and so on for all the other builtin's that are "new". If there are going
to be more, then we should consider the use of config.h{.in} and using
that instead of passing cpp macros flags on the command line.
I can work up a patch if interested.
Regards,
Mumit