Bug 648735 - OpenBSD: Add missing limits.h and sys/param.h; r=cjones

otherwise fails with:
/usr/include/sys/proc.h:64: error: 'MAXLOGNAME' was not declared in this scope
/usr/include/sys/proc.h:287: error: 'MAXCOMLEN' was not declared in this scope

Don't try to include execinfo.h/use backtrace* funcs on OpenBSD too, otherwise fails with
../../dist/system_wrappers/execinfo.h:3:27: error: execinfo.h: No such file or directory
In constructor 'StackTrace::StackTrace()':
/home/landry/src/mozilla-central/ipc/chromium/src/base/debug_util_posix.cc:125: error: 'backtrace' was not declared in this scope
/home/landry/src/mozilla-central/ipc/chromium/src/base/debug_util_posix.cc: In member function 'void StackTrace::PrintBacktrace()':
/home/landry/src/mozilla-central/ipc/chromium/src/base/debug_util_posix.cc:144: error: 'backtrace_symbols_fd' was not declared in this scope
This commit is contained in:
Landry Breuil 2011-09-21 18:36:52 +01:00
parent b48a671937
commit 6e7fe377a8

View File

@ -5,13 +5,17 @@
#include "build/build_config.h"
#include "base/debug_util.h"
#define MOZ_HAVE_EXECINFO_H (!defined(ANDROID) && !defined(__OpenBSD__))
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <limits.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/types.h>
#include <unistd.h>
#ifndef ANDROID
#if MOZ_HAVE_EXECINFO_H
#include <execinfo.h>
#include <sys/sysctl.h>
#endif
@ -119,7 +123,7 @@ StackTrace::StackTrace() {
const int kMaxCallers = 256;
void* callers[kMaxCallers];
#ifndef ANDROID
#if MOZ_HAVE_EXECINFO_H
int count = backtrace(callers, kMaxCallers);
#else
int count = 0;
@ -138,7 +142,7 @@ StackTrace::StackTrace() {
void StackTrace::PrintBacktrace() {
fflush(stderr);
#ifndef ANDROID
#if MOZ_HAVE_EXECINFO_H
backtrace_symbols_fd(&trace_[0], trace_.size(), STDERR_FILENO);
#endif
}