tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] TCC and round()


From: avih
Subject: Re: [Tinycc-devel] TCC and round()
Date: Tue, 28 Jun 2016 20:55:21 +0000 (UTC)

Re round, it appears you're using tcc on Windows, at which case, round should work out of the box with recent mob (0.9.26 has been the version number for some years, but there has been advancements since it was officially released).

Specifically for round on Windows, it's declared at win32/include/math.h and defined at win32/include/tcc/tcc_libm.h (which is included from the former so you only need to #include <math.h> for it to work). This file also defines some other libm/math related functions which are not necessarily available at msvcrt. It was added some months ago.

See http://repo.or.cz/tinycc.git/blob/HEAD:/win32/include/tcc/tcc_libm.h





On Tuesday, June 28, 2016 11:41 PM, Brad Elliott <address@hidden> wrote:


Hmm, I appear to be able to get it to work by modifying lib/msvcrt.def to link against msvcr120.dll instead of msvcr.dll and manually adding the definition for round:
 
  LIBRARY msvcr120.dll
 
  EXPORTS
  …
  round
 
Is this a safe thing to do?
 
Brad
 
From: Brad Elliott
Sent: June-28-16 12:19 PM
To: 'address@hidden' <address@hidden>
Subject: TCC and round()
 
Hi everyone,
 
Has anyone had success getting round() to work in TCC without implementing my own? Version 0.9.26 looks like it added support for C99 and I can see the prototype in math.h but I can’t compile it:
 
     tcc: error: undefined symbol 'round'
 
This is the simple example I was using:
 
    #include <stdio.h>
    #include <math.h>
    #include <stdlib.h>
 
    int main(void)
    {
        printf("%f\n", round(0.1));
        return EXIT_SUCCESS;
    }
 
I don’t see any options to specifically enable C99 like the --std=c99 in GCC.
 
Any ideas?

Thanks,
 
Brad Elliott

_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]