Closed Bug 909914 Opened 6 years ago Closed 6 years ago
Error: "Use of undeclared identifier 'getpid'" if build with enable-macos-target=10
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); ^~~~~ 2 errors generated. make: *** [TimeStamp_darwin.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [libs] Error 2 make: *** [libs_tier_platform] Error 2 make: *** [tier_platform] Error 2 make: *** [default] Error 2 make: *** [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
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.
(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
Assignee: nobody → Nomis101
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.