24 |
|
|
25 |
(I have not tested this patch under win32 yet.) |
(I have not tested this patch under win32 yet.) |
26 |
|
|
27 |
|
Here is David's e-mail: |
28 |
|
|
29 |
|
Hi, |
30 |
|
|
31 |
|
Attached to this email you find a diff against sml/nj 110.45 |
32 |
|
that will enable socket support under Windows. |
33 |
|
|
34 |
|
To apply the patch (using unix or cygwin) |
35 |
|
1) gunzip runtime.diff.gz |
36 |
|
2) "cd" into "src/runtime" in the source tree of a fresh |
37 |
|
110.45 installation. |
38 |
|
3) patch -p 1 < [your/path/to]runtime.diff |
39 |
|
|
40 |
|
The code compiles fine but has NOT yet been extensively tested. |
41 |
|
I only ran a few tests for basic socket client functionality |
42 |
|
(which worked fine). Especially the functions that use ioctl |
43 |
|
are not tested at all and might not work (see below). |
44 |
|
|
45 |
|
I implemented this since we want to move to a newer version of sml/nj |
46 |
|
but need socket support in order to use it. This is the first time I |
47 |
|
even had a look at the sml/nj source, so please review my changes |
48 |
|
before making this part of the distribution! Here are a few issues |
49 |
|
that I think might be better for someone to solve who is more |
50 |
|
familiar with the sml/nj source (and socket programming): |
51 |
|
|
52 |
|
- getnetbyaddr.c and getnetbyname.c will raise a "not implemented" |
53 |
|
exception since I could not figure out what the windows equivalent |
54 |
|
of these functions is |
55 |
|
|
56 |
|
- In sockets-osdep.h there are a some #include statements that are |
57 |
|
only used in a few files that include sockets-osdep.h |
58 |
|
|
59 |
|
- In smlnj-sock-lib.c, function init_fn() calls WSAStartup() but |
60 |
|
does not process its return value since I don't know how to |
61 |
|
report an error upwards. |
62 |
|
|
63 |
|
- It would probably be good to have a call to WSACleanup() when |
64 |
|
the library is unloaded (if there is such a possibility). |
65 |
|
Otherwise I think Windows will take care of this automatically |
66 |
|
when the process finishes. |
67 |
|
|
68 |
|
- I used ioctlsocket() as a replacement for ioctl() but I have |
69 |
|
no idea if that is actually the proper replacement on Windows. |
70 |
|
|
71 |
|
- All these issues are marked in the code by "FIXME" comments. |
72 |
|
|
73 |
|
We use sml/nj extensively in our products and are quite happy |
74 |
|
with it. I hope this contribution will help you. |
75 |
|
|
76 |
|
Keep up the good work! |
77 |
|
|
78 |
|
David |
79 |
|
|
80 |
---------------------------------------------------------------------- |
---------------------------------------------------------------------- |
81 |
Name: Matthias Blume (blume (at) tti - c (dot) org) |
Name: Matthias Blume (blume (at) tti - c (dot) org) |
82 |
Date: 2004/05/11 14:20:00 CDT |
Date: 2004/05/11 14:20:00 CDT |