Right now plevent.c includes the NSPR internal header primpl.h. This is an obstacle to moving PLEvents out of NSPR. The main reason that plevent.c needs to include primpl.h is to access the 'entryCount' field of the opaque structure PRMonitor. This can be avoided by calling the PR_GetMonitorEntryCount() function. The current code reads 'entryCount' only if PR_GetMonitorEntryCount() is nonzero. If PR_GetMonitorEntryCount() returns a nonzero value, that value is the 'entryCount' field of the PRMonitor. So the read of the 'entryCount' field is not necessary. Since primpl.h pulls in a lot of system header files, plevent.c may indirectly depend on them. For example, on WIN32 plevent.c gets <windows.h> through primpl.h. If we remove the inclusion of primpl.h, we will need to include <windows.h>.
Steve, could you test the patched plevent.c (second attachment, id=2373) on the Mac? Thanks.
Verified on Mac - no problems compiling.
Thanks, Steve. Now I need a code reviewer. :-)
The modifications look good.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Thanks for the code review, Srinivas. I just checked in the fix. /cvsroot/mozilla/nsprpub/lib/ds/Makefile, revision 3.16 /cvsroot/mozilla/nsprpub/lib/ds/Makefile.in, revision 1.7 /cvsroot/mozilla/nsprpub/lib/ds/plevent.c, revision 3.29
You need to log in before you can comment on or make changes to this bug.