Re: Building NSPR with mods that depend on winsock2.h, mswsock.h, and ws2tcpip.h
Wan-Teh Chang <[email protected]> Thu, 29 Jan 2009 12:08:52 -0800
| Newsgroups | gmane.comp.mozilla.devel.nspr |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Jan 22, 2009 at 5:52 PM, Jon Leighton <[email protected]> wrote: > Please let me know if this should be posted in a different newsgroup. > (moz.dev.builds?) I'm working on modifying NSPR to support SCTP and I'm > running into some problems trying to build NSPR (WIN95 target) on Windows XP > (with which I'm not very familiar). The problem I'm running into is that > I've made some modifications to prio.h that use several structures defined > in the SCTP header file. I've included the SCTP header file in my prio.h, > but that's not sufficient. As nearly as I understand it, building NSPR with > a WIN95 target is done with winsock.h and a few items plucked from > winsock2.h, but the SCTP header file depends on several things defined in > winsock2.h, mswsock.h and ws2tcpip.h. As a first cut, I've been trying to > identify those items and define them in a header file that I include in > prio.h ahead of the SCTP header file. I don't have a solid enough > understanding of the relationships among the various NSPR include files to > be sure that this is a viable approach, and I suspect that even if it is > there's probably a cleaner approach. I'd be grateful for any suggestions > about how to make this work, or a better way to approach it. Thanks very > much. Hi Jon, This newsgroup is the right one for this question. You need to solve two problems. 1. prio.h should not depend on structures defiined in the system SCTP header file. Instead, it needs to define its own equivalent structures. For convenience, it can define its own structures to be "isomorphic" to the real SCTP structures, so that we can safely cast a pointer to one to a pointer to the other. But that's not required -- our code can also map one structure to the other by manual copying of the fields. 2. The second problem is the <winsock.h> vs. <winsock2.h> issue. I believe that the problem is opposite to what you described. NSPR includes <winsock2.h>, and has to go out of its ways to include <winsock.h> in isolated cases, for example, http://mxr.mozilla.org/nspr/source/nsprpub/pr/src/io/prmapopt.c So hopefully this is a non-issue for you. Wan-Teh