This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: llrint implementation in Cygwin


Hi,

Tim Prince <tprince <at> computer.org> writes:
> 
> Diego Biurrun wrote:
> > Hi!
> > 
> > I have noticed that Cygwin does not implement llrint.  However, llrint
> > is part of C99 and not having it available makes some applications (for
> > example MPlayer and FFmpeg) fail to compile.
> > 
> > Are there any plans to implement llrint (in the near future)?
> > 
> 
> Perhaps if you would submit a patch to newlib, something may happen.
> It's not difficult to back-port stand-alone from recent gcc if you don't
> want to wait for cygwin to include a gcc upgrade, about which there have
> been plenty of threads here.  You could include it in a <mathinline.h>
> of your choice.
> http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01970.html
> http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01973.html
> shows that it has been available for 2.5 years. 

I downloaded the gcc-3.4.4 Cygwin source package, and I found that (apparently)
gcc 3.4.4 already had llrint built-in:

$ fgrep -ri llrint gcc-3.4.4 
gcc-3.4.4/gcc/builtins.c:      CASE_MATHFN (BUILT_IN_LLRINT)
gcc-3.4.4/gcc/builtins.def:DEF_C99_BUILTIN        (BUILT_IN_LLRINT, "llrint",
BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)

[more lines matched]

Then I tried to compile a test:
$ cat llrint_test.c 
#include <math.h>
int main(int argc, char **argv)
{
  long long ll;

  ll = __builtin_llrint(2.34);
}

But the compilation failed:
$ gcc llrint_test.c 
/cygdrive/c/DOCUME~1/Inma/LOCALS~1/Temp/ccyDtvBd.o:llrint_test.c:(.text+0x34):
undefined reference to `_llrint'
collect2: ld returned 1 exit status

Are built-ins disabled in gcc-3.4.4 for Cygwin?
Could that be fixed by adding/removing flags to the configure line used
to build gcc 3.4.4 in Cygwin?

Thanks in advance for your answers,
Victor Paesa


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]