Changes

Jump to: navigation, search

User:Jamesboston/nsIProcess/meeting-102908

1,679 bytes added, 18:18, 29 October 2008
New page: <pre> 13:06 < jboston> I've got a pointer, PRProcess* mProcess that is really a struct, but on one platform that struct only contains a int. Is there way to access that in...
<pre>
13:06 < jboston> I've got a pointer, PRProcess* mProcess that is really a struct, but on one platform that struct
only contains a int. Is there way to access that int without having to tell the compiler the how the
stuct is declared. I would think so, but no matter how I do it, I get compiler errors about type
conversions. Here's a bit of code to explain: http://pastebin.mozilla.org/563998
13:07 < jboston> bsmedberg: ^^ Perhaps you have advice.
13:08 < Fallen> jboston: are you actually using int* ? PRUint32 is unsigned int
13:09 < bsmedberg> jboston: this sounds like a bad idea
13:09 < jboston> Fallen: I was using a PRUint32 * for my cast. That's just a simplified example of what I'm trying to
get at.
13:09 < jboston> bsmedberg: I agree. It's kind of a hacky way to achieve getting the PID.
13:09 < bsmedberg> jboston: you shouldn't go assuming things about the internal structure of PRProcess
13:09 < bsmedberg> jboston: if you really need to do this, you should just reimplement PRProcess
13:10 < bsmedberg> so that you have control
13:11 < jboston> bsmedberg: Is there a way to include the declaration of PRProcess into the nsIProcess header?
13:12 < bsmedberg> not a good way, no
13:12 < jboston> ok
13:14 < jboston> bsmedberg: When you say re-inplement PRProcess, do you mean the NSPR interface for handling
processes? I could just add a method to return a PID in there.
13:14 < bsmedberg> jboston: well, you could just add a NSPR interface PR_GetProcessPID, perhaps
13:14 < bsmedberg> or just reimplement process handling
13:15 < jboston> Implement outside of NSPR?
</pre>

Navigation menu