Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two quick changes to make ninja compile on FreeBSD #5

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.ninja
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rule cxx
description = CC $out

rule ar
command = ar crsT $out $in
command = ar crs $out $in
description = AR $out

rule link
Expand Down
9 changes: 0 additions & 9 deletions src/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,16 @@

#include "util.h"

#include <execinfo.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

void DumpBacktrace(int skip_frames) {
void* stack[256];
int size = backtrace(stack, 256);
++skip_frames; // Skip ourselves as well.
backtrace_symbols_fd(stack + skip_frames, size - skip_frames, 2);
}

void Fatal(const char* msg, ...) {
va_list ap;
fprintf(stderr, "FATAL: ");
va_start(ap, msg);
vfprintf(stderr, msg, ap);
va_end(ap);
fprintf(stderr, "\n");
DumpBacktrace(1);
exit(1);
}