Closed Bug 909914 Opened 12 years ago Closed 12 years ago

Error: "Use of undeclared identifier 'getpid'" if build with enable-macos-target=10.9

Categories

(Core :: XPCOM, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: Nomis101, Assigned: Nomis101)

References

Details

Attachments

(1 file)

If building with the 10.9 SDK I also see this error: nfig.h -MD -MP -MF .deps/TimeStamp_darwin.o.pp /Volumes/Developer/comm-central/mozilla/xpcom/ds/TimeStamp_darwin.cpp 1 warning generated. /Volumes/Developer/comm-central/mozilla/xpcom/ds/TimeStamp_darwin.cpp:189:5: error: use of undeclared identifier 'getpid' getpid(), ^ /Volumes/Developer/comm-central/mozilla/xpcom/ds/TimeStamp_darwin.cpp:191:24: error: invalid application of 'sizeof' to an incomplete type 'int []' u_int mibLen = sizeof(mib) / sizeof(mib[0]); ^~~~~ 2 errors generated. make[6]: *** [TimeStamp_darwin.o] Error 1 make[6]: *** Waiting for unfinished jobs.... make[5]: *** [libs] Error 2 make[4]: *** [libs_tier_platform] Error 2 make[3]: *** [tier_platform] Error 2 make[2]: *** [default] Error 2 make[1]: *** [default] Error 2 make: *** [build] Error 2
getpid() is (or should be) defined in unistd.h. Did you also get a "missing header file" error?
There is also an unistd.h in 10.9SDK, but I see no "missing header file" error. I only see the two errors from #0.
I only see this error if I build with the 10.9 SDK and --enable-macos-target=10.9, if I build without --enable-macos-target=10.9 I don't see this error.
Summary: [10.9 SDK]: use of undeclared identifier 'getpid' → Error: "Use of undeclared identifier 'getpid'" if build with enable-macos-target=10.9
Attached patch FixSplinter Review
With this patch I can build with -enable-macos-target=10.9
Attachment #8350580 - Attachment description: Bug909914.txt → Fix
Comment on attachment 8350580 [details] [diff] [review] Fix You should set the review flag so people will look at your patch. :)
Attachment #8350580 - Flags: review?(smichaud)
Comment on attachment 8350580 [details] [diff] [review] Fix Nice and simple. Thanks! I did a test build without this patch, with the 10.9 SDK and --enable-macos-target=10.9 -- the build failed with this bug's error. The error disappeared with your patch. I got another error in /toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc, though (twice): "error: use of undeclared identifier 'pthread_create'" But that's another bug (as yet unfiled). Feel free to open a bug for it and fix it, too :-)
Attachment #8350580 - Flags: review?(smichaud) → review+
Thanks, I have not seen the breakpad error, because I normally build with disabled crashreporter. I will look into this.
Keywords: checkin-needed
(In reply to Steven Michaud from comment #6) > "error: use of undeclared identifier 'pthread_create'" > > But that's another bug (as yet unfiled). > > Feel free to open a bug for it and fix it, too :-) Bug 952623
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: