delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2000/01/07/14:06:15

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-developers-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs
Date: Fri, 7 Jan 2000 13:08:27 -0600 (CST)
From: Mumit Khan <khan AT NanoTech DOT Wisc DOT EDU>
To: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: use of __builtin_memset
Message-ID: <Pine.HPP.3.96.1000107125535.1532V-100000@hp2.xraylith.wisc.edu>
MIME-Version: 1.0

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019