-
-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ttyrec: add implicit declaration flag
- Loading branch information
1 parent
68abe1f
commit d7eaa82
Showing
1 changed file
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,15 +31,22 @@ class Ttyrec < Formula | |
sha256 "76b8153476565c5c548aa04c2eeaa7c7ec8c1385bcf8b511c68915a3a126fdeb" | ||
end | ||
|
||
# Fixes "ttyrec.c:209:20: error: storage size of ‘status’ isn’t known"; | ||
# check `man 2 wait3`. | ||
patch :DATA | ||
|
||
def install | ||
# Fix compile with newer Clang | ||
ENV.append_to_cflags "-Wno-implicit-function-declaration" if DevelopmentTools.clang_build_version >= 1403 | ||
|
||
# macOS has openpty() in <util.h> | ||
# Reported by email to [email protected] on 2017-12-20 | ||
inreplace "ttyrec.c", "<libutil.h>", "<util.h>" if OS.mac? | ||
|
||
# openpty is a BSD function | ||
cflags = OS.mac? ? "-DHAVE_openpty" : nil | ||
ENV.append_to_cflags "-DHAVE_openpty" if OS.mac? | ||
|
||
system "make", "CFLAGS=#{cflags}" | ||
system "make", "CFLAGS=#{ENV.cflags}" | ||
bin.install %w[ttytime ttyplay ttyrec] | ||
man1.install Dir["*.1"] | ||
end | ||
|
@@ -50,3 +57,19 @@ def install | |
end | ||
end | ||
end | ||
|
||
__END__ | ||
--- a/ttyrec.c | ||
+++ b/ttyrec.c | ||
@@ -203,11 +203,7 @@ doinput() | ||
void | ||
finish() | ||
{ | ||
-#if defined(SVR4) | ||
int status; | ||
-#else /* !SVR4 */ | ||
- union wait status; | ||
-#endif /* !SVR4 */ | ||
register int pid; | ||
register int die = 0; | ||
|