From: Danny Smith <dannysmith@cl...>  20030106 10:16:18

 Original Message  From: "Wu Yongwei" <adah@...> To: "mingwdvlpr" <mingwdvlpr@...> Sent: Monday, 6 January 2003 09:54 Subject: Re: [MinGWdvlpr] _CRTIMP again. > > Testing with your examples showed another problem: defining USE_DECLSPEC > does not work with GCC 2. The error message is like: > > C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccGmbaaa.o(.text+0x7d):test.c: > undefined reference to `import stub for log(double)' > C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ccGmbaaa.o(.text+0x93):test.c: > undefined reference to `import stub for exp(double)' > ... > Any explanations? No, not for that. I forgot to mention that need std=c99 for the testcase to compile. I got different errors with gcc2, related to C99 extensions. After modifying so that all variables are declared at start of scope as per c89, the test compiled and linked okay with gcc2 > > > If it is still wanted to do it, I will do it. Which headers should I > use as the base (CVS/release)? CVS. And if it is not urgent, I would prefer > to delay it for 3 weeks. > Not urgent I can make a start with math.h, test and then move on from there, one header at a time. Is everyone agreed to use _CRTIMP macro for __declspec(dllimport)? Danny > Best regards, > > Wu Yongwei > >  Original Message from Danny Smith  > ... > > #include <stdio.h> > #include <time.h> > #include <stdlib.h> > #ifdef USE_DECLSPEC > __declspec(dllimport) double sin (double); > __declspec(dllimport) double cos (double); > __declspec(dllimport) double tan (double); > __declspec(dllimport) double exp (double); > __declspec(dllimport) double log (double); > __declspec(dllimport) double log10 (double); > __declspec(dllimport) double pow (double, double); > __declspec(dllimport) double sqrt (double); > #else > #include <math.h> > #endif > > int main(void) > { > clock_t start, finish; > > start = clock(); > > double sum = 0.0; > for (double i = 0; i < 1e6; i++) > { > double val = (double) i + 0.01; > sum += log(val); > sum += exp(val); > sum += sin(val); > sum += cos(val); > sum += tan(val); > sum += log10(val); > sum += sqrt(val); > sum += pow(val, 4.567); > } > > finish = clock(); > > double duration = (double)(finish  start) / CLOCKS_PER_SEC; > > printf ("sum is %.3f\n", sum); > printf ("Elapsed time = %.3f s\n", duration); > return 0; > } > > Wu, have you made any progress on your proposed modifications to the > runtime headers? > > Danny > > > >  > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > MinGWdvlpr mailing list > MinGWdvlpr@... > https://lists.sourceforge.net/lists/listinfo/mingwdvlpr 