[Mono-list] Multiplatform DllImport?

Christian Ratliff cratliff@lily.org
Fri, 23 Nov 2001 15:43:04 -0500


 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  How are we supposed to be dealing with classes which offer platform
services (e.g. System.Net.Sockets.Socket)? This class will need to
import not only things like socket, bind, listen, connect, but also
Win32 (Winsock) functions like WSAStartup and WSACleanup. I hate to
ask before looking so...

The "Classes" web page on go-mono.com indicates the class names ought
to be Platform-Classname.cs, but there are no such files in the
snapshot. Is this the right way?

I looked for some other example in the code base, and the latest
snapshot contains mcs/class/System/System.Net/Dns.cs. That file has a
DllImport which explicitly mentions the cygwin DLL as the source for
gethostbyaddr and gethostbyname. Is this the right way?

Meanwhile, there is a file called mcs/class/corlib/Windows/Windows.cs
which implements System.PAL.OpSys. This file contains DllImports for
many common math library functions. The Linux version
(mcs/class/corlib/Linux/Linux.cs) contains only stubs, no real
imports. Is this the right way?

  Suffice it to say that I am confused about how this is to be
managed.

Sorry!
christian

+-----+
Christian Ratliff <cratliff@lily.org>
lily Development Group
"This is the very perfection of man, 
  to find out his own imperfections" -  St. Augustine

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBO/6017ZBtyfwMNgGEQLfRACg2d5i0J7KAvHJTHq9Q3cA4M3BTUUAoIu8
/r8ML4YWlzl3/8kyS+v+HBdX
=EeZV
-----END PGP SIGNATURE-----