Re: Need help implementing a machine dependent function

Nelson Bolyard <[email protected]> Tue, 26 May 2009 09:53:51 -0700
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
Jon Leighton wrote, On 2009-05-25 00:25 PDT:

> I tried to mimic this in Mac OS X with _PR_MD_SCTP_RECVMSG by adding the 
> following
> 
> in file primpl.h
> extern PRInt32 _PR_MD_SCTP_RECVMSG(...);
> #define  _PR_MD_SCTP_RECVMSG     _MD_SCTP_RECVMSG

> When I try to build I end up with a warning about an implicit definition 
> of _PR_MD_SCTP_RECVMSG in ptio.c (where I call the function), and the 
> build fails on nspr.dylib stating that _PR_MD_SCTP_RECV is an undefined 
> symbol.  I can include the compiler output if that would be helpful.

The obvious implication of that warning/error is that one of the following
is true:
1) ptio.c did not include primpl.h or
2) the lines you added to primpl.h were inside a #if that was false, or
3) the copy of primpl.h that the compiler used did not contain your changes.

Did you do a full rebuild of NSPR after making your changes?
I'd suggest you start by doing a full rebuild.
Go into mozilla/nsprpub and find the directory in there that is created
by the build (name ends in .OBJ) and rm -rf it.  Then rebuild.

If that doesn't fix it, then the next step is to look at the output of
the c pre-processor for ptio.c, and look for your changes.  You won't see
the #defines, but you should see your other additions.  If you don't then
you need to figure out why.  The answer is likely #if or #ifdef.

-- 
12345678901234567890123456789012345678901234567890123456789012345678901234567890
00000000011111111112222222222333333333344444444445555555555666666666677777777778