tan not exported by msvcrt, ntdll

Francois Gouget fgouget at free.fr
Sun Jun 3 20:58:33 CDT 2001


   I tried compiling Winelib applications without '-lm' (btw, the
comment in configure.in is incorrect, it concerns Linux too, not just
BeOS). But I had undefined symbol errors for applications that use tan
and a couple other math functions. The reason is that both ntdll and
msvcrt declare them with '-noimport':
 * msvcrt.spec:
   @ forward -noimport tan ntdll.tan
 * ntdll.spec:
   @ cdecl -noimport tan(double) tan   

   So a Winelib application that imports msvcrt and ntdll does not get
tan and thus must link with libm in the Unix sense. sin, cos and most
others were ok though!


Changelog:

 * dlls/msvcrt/msvcrt.spec

   Remove some '-noimport' for math functions


--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
                            1 + e ^ ( i * pi ) = 0


-------------- next part --------------
Index: dlls/msvcrt/msvcrt.spec
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/msvcrt.spec,v
retrieving revision 1.15
diff -u -r1.15 msvcrt.spec
--- dlls/msvcrt/msvcrt.spec	2001/05/31 21:32:53	1.15
+++ dlls/msvcrt/msvcrt.spec	2001/06/03 19:42:29
@@ -565,28 +571,28 @@
 @ stub _wsystem #(wstr)
 @ cdecl _wtempnam(wstr wstr) _wtempnam
 @ stub _wtmpnam #(wstr)
-@ forward -noimport _wtoi NTDLL._wtoi
+@ forward -noimport _wtoi ntdll._wtoi
 @ stub _wtoi64 #(wstr)
-@ forward _wtol NTDLL._wtol
+@ forward _wtol ntdll._wtol
 @ cdecl _wunlink(wstr) _wunlink
 @ cdecl _wutime(wstr ptr) _wutime
 @ cdecl _y0(double) _y0
 @ cdecl _y1(double) _y1
 @ cdecl _yn(long double ) _yn
 @ cdecl abort() MSVCRT_abort
-@ forward -noimport abs ntdll.abs
-@ cdecl acos( double ) acos
+@ cdecl abs(long) abs
+@ cdecl acos(double) acos
 @ cdecl asctime(ptr) asctime
 @ cdecl asin(double) asin
-@ forward -noimport atan ntdll.atan
+@ cdecl atan(double) atan
 @ cdecl atan2(double double) atan2
 @ cdecl atexit(ptr) MSVCRT_atexit
 @ cdecl atof(str) atof
 @ cdecl atoi(str) atoi
 @ cdecl atol(str) atol
 @ cdecl bsearch(ptr ptr long long ptr) bsearch
 @ cdecl calloc(long long) MSVCRT_calloc
-@ forward -noimport ceil ntdll.ceil
+@ cdecl ceil(double) ceil
 @ cdecl clearerr(ptr) MSVCRT_clearerr
 @ cdecl clock() MSVCRT_clock
 @ cdecl cos(double) cos
@@ -596,7 +602,7 @@
 @ cdecl -noimport div(long long) MSVCRT_div
 @ cdecl exit(long) MSVCRT_exit
 @ cdecl exp(double) exp
-@ forward -noimport fabs ntdll.fabs
+@ cdecl fabs(double) fabs
 @ cdecl fclose(ptr) MSVCRT_fclose
 @ cdecl feof(ptr) MSVCRT_feof
 @ cdecl ferror(ptr) MSVCRT_ferror
@@ -606,7 +612,7 @@
 @ cdecl fgets(str long ptr) MSVCRT_fgets
 @ cdecl fgetwc(ptr) MSVCRT_fgetwc
 @ stub fgetws #(wstr long ptr)
-@ forward -noimport floor ntdll.floor
+@ cdecl floor(double) floor
 @ cdecl fmod(double double) fmod
 @ cdecl fopen(str str) MSVCRT_fopen
 @ varargs fprintf(ptr str) MSVCRT_fprintf
@@ -658,12 +664,12 @@
 @ cdecl iswupper(long) MSVCRT_iswupper
 @ cdecl iswxdigit(long) MSVCRT_iswxdigit
 @ cdecl isxdigit(long) MSVCRT_isxdigit
-@ forward -noimport labs ntdll.labs
+@ cdecl labs(long) labs
 @ cdecl ldexp( double long) MSVCRT_ldexp
 @ cdecl -noimport ldiv(long long) MSVCRT_ldiv
 @ stub localeconv #()
 @ cdecl localtime(ptr) localtime
-@ forward -noimport log ntdll.log
+@ cdecl log(double) log
 @ cdecl log10(double) log10
 @ cdecl longjmp(long long) MSVCRT_longjmp
 @ cdecl malloc(long) MSVCRT_malloc
@@ -700,7 +706,7 @@
 @ cdecl sin(double) sin
 @ cdecl sinh(double) sinh
 @ varargs sprintf(ptr str) sprintf
-@ forward -noimport sqrt ntdll.sqrt
+@ cdecl sqrt(double) sqrt
 @ cdecl srand(long) srand
 @ varargs sscanf(str str) sscanf
 @ cdecl strcat(str str) strcat
@@ -727,7 +733,7 @@
 @ forward -noimport swprintf ntdll.swprintf
 @ stub swscanf #(wstr wstr) varargs
 @ cdecl system(str) MSVCRT_system
-@ forward -noimport tan ntdll.tan
+@ cdecl tan(double) tan
 @ cdecl tanh(double) tanh
 @ cdecl time(ptr) MSVCRT_time
 @ cdecl tmpfile() MSVCRT_tmpfile


More information about the wine-devel mailing list