Fix up builtin_wait build system

Add missing CMake and Xcode files, and mark some variables as const
reference.
This commit is contained in:
ridiculousfish 2017-11-16 10:46:44 -08:00
parent c7a682ed05
commit 7c8ed80e64
3 changed files with 24 additions and 14 deletions

View file

@ -28,17 +28,17 @@ SET(FISH_SRCS
src/builtin_random.cpp src/builtin_read.cpp src/builtin_realpath.cpp
src/builtin_return.cpp src/builtin_set.cpp src/builtin_set_color.cpp
src/builtin_source.cpp src/builtin_status.cpp src/builtin_string.cpp
src/builtin_test.cpp src/builtin_ulimit.cpp src/color.cpp src/common.cpp
src/complete.cpp src/env.cpp src/env_universal_common.cpp src/event.cpp
src/exec.cpp src/expand.cpp src/fallback.cpp src/fish_version.cpp
src/function.cpp src/highlight.cpp src/history.cpp src/input.cpp
src/input_common.cpp src/intern.cpp src/io.cpp src/iothread.cpp
src/kill.cpp src/output.cpp src/pager.cpp src/parse_execution.cpp
src/parse_productions.cpp src/parse_tree.cpp src/parse_util.cpp
src/parser.cpp src/parser_keywords.cpp src/path.cpp src/postfork.cpp
src/proc.cpp src/reader.cpp src/sanity.cpp src/screen.cpp src/signal.cpp
src/tokenizer.cpp src/utf8.cpp src/util.cpp src/wcstringutil.cpp
src/wgetopt.cpp src/wildcard.cpp src/wutil.cpp
src/builtin_test.cpp src/builtin_ulimit.cpp src/builtin_wait.cpp
src/color.cpp src/common.cpp src/complete.cpp src/env.cpp
src/env_universal_common.cpp src/event.cpp src/exec.cpp src/expand.cpp
src/fallback.cpp src/fish_version.cpp src/function.cpp src/highlight.cpp
src/history.cpp src/input.cpp src/input_common.cpp src/intern.cpp src/io.cpp
src/iothread.cpp src/kill.cpp src/output.cpp src/pager.cpp
src/parse_execution.cpp src/parse_productions.cpp src/parse_tree.cpp
src/parse_util.cpp src/parser.cpp src/parser_keywords.cpp src/path.cpp
src/postfork.cpp src/proc.cpp src/reader.cpp src/sanity.cpp src/screen.cpp
src/signal.cpp src/tokenizer.cpp src/utf8.cpp src/util.cpp
src/wcstringutil.cpp src/wgetopt.cpp src/wildcard.cpp src/wutil.cpp
)
# Header files are just globbed.

View file

@ -204,6 +204,10 @@
D013CE381F52964D00AB1419 /* libmuparser.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D06821651F51490E00040321 /* libmuparser.a */; };
D01A2D24169B736200767098 /* man1 in Copy Files */ = {isa = PBXBuildFile; fileRef = D01A2D23169B730A00767098 /* man1 */; };
D01A2D25169B737700767098 /* man1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = D01A2D23169B730A00767098 /* man1 */; };
D02960E61FBD726200CA3985 /* builtin_wait.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D02960E51FBD726100CA3985 /* builtin_wait.cpp */; };
D02960E71FBD726200CA3985 /* builtin_wait.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D02960E51FBD726100CA3985 /* builtin_wait.cpp */; };
D02960E81FBD726200CA3985 /* builtin_wait.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D02960E51FBD726100CA3985 /* builtin_wait.cpp */; };
D02960E91FBD726200CA3985 /* builtin_wait.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D02960E51FBD726100CA3985 /* builtin_wait.cpp */; };
D030FBEF1A4A382000F7ADA0 /* input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0A0854A13B3ACEE0099B651 /* input.cpp */; };
D030FBF01A4A382B00F7ADA0 /* event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0A0853B13B3ACEE0099B651 /* event.cpp */; };
D030FBF11A4A384000F7ADA0 /* output.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0A0855113B3ACEE0099B651 /* output.cpp */; };
@ -700,6 +704,7 @@
D025C02715D1FEA100B9DB63 /* completions */ = {isa = PBXFileReference; lastKnownFileType = folder; name = completions; path = share/completions; sourceTree = "<group>"; };
D025C02815D1FEA100B9DB63 /* functions */ = {isa = PBXFileReference; lastKnownFileType = folder; name = functions; path = share/functions; sourceTree = "<group>"; };
D025C02915D1FEA100B9DB63 /* tools */ = {isa = PBXFileReference; lastKnownFileType = folder; name = tools; path = share/tools; sourceTree = "<group>"; };
D02960E51FBD726100CA3985 /* builtin_wait.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = builtin_wait.cpp; sourceTree = "<group>"; };
D031890915E36D9800D9CC39 /* base */ = {isa = PBXFileReference; lastKnownFileType = text; path = base; sourceTree = BUILT_PRODUCTS_DIR; };
D03238891849D1980032CF2C /* pager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pager.cpp; sourceTree = "<group>"; };
D032388A1849D1980032CF2C /* pager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pager.h; sourceTree = "<group>"; };
@ -1123,6 +1128,7 @@
D0C6FCC914CFA4B0004CE8AD /* autoload.cpp */,
D05F592E1F041AE4003EE978 /* builtin.h */,
D05F592F1F041AE4003EE978 /* builtin.cpp */,
D02960E51FBD726100CA3985 /* builtin_wait.cpp */,
D05F59301F041AE4003EE978 /* builtin_ulimit.h */,
D05F59311F041AE4003EE978 /* builtin_ulimit.cpp */,
D05F59321F041AE4003EE978 /* builtin_test.h */,
@ -1768,6 +1774,7 @@
9C7A554E1DCD71330049C25D /* function.cpp in Sources */,
9C7A554F1DCD71330049C25D /* complete.cpp in Sources */,
9C7A55501DCD71330049C25D /* env.cpp in Sources */,
D02960E91FBD726200CA3985 /* builtin_wait.cpp in Sources */,
9C7A55511DCD71330049C25D /* exec.cpp in Sources */,
9C7A55521DCD71330049C25D /* wcstringutil.cpp in Sources */,
9C7A55531DCD71330049C25D /* expand.cpp in Sources */,
@ -1800,6 +1807,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D02960E81FBD726200CA3985 /* builtin_wait.cpp in Sources */,
9C7A552F1DCD65820049C25D /* util.cpp in Sources */,
D05F59971F041AE4003EE978 /* builtin_printf.cpp in Sources */,
D05F59A31F041AE4003EE978 /* builtin_function.cpp in Sources */,
@ -1984,6 +1992,7 @@
D030FC081A4A38F300F7ADA0 /* pager.cpp in Sources */,
D030FC091A4A38F300F7ADA0 /* parse_util.cpp in Sources */,
D0D02AD9159864A6008E62BD /* parser_keywords.cpp in Sources */,
D02960E71FBD726200CA3985 /* builtin_wait.cpp in Sources */,
D05F59A51F041AE4003EE978 /* builtin_fg.cpp in Sources */,
D05F596F1F041AE4003EE978 /* builtin.cpp in Sources */,
D05F598D1F041AE4003EE978 /* builtin_read.cpp in Sources */,
@ -2016,6 +2025,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D02960E61FBD726200CA3985 /* builtin_wait.cpp in Sources */,
D0D02A7C159839D5008E62BD /* autoload.cpp in Sources */,
D05F59951F041AE4003EE978 /* builtin_printf.cpp in Sources */,
D05F59A11F041AE4003EE978 /* builtin_function.cpp in Sources */,

View file

@ -63,7 +63,7 @@ static void wait_for_backgrounds(bool any_flag) {
}
}
static bool all_specified_jobs_finished(std::vector<int> wjobs_pid) {
static bool all_specified_jobs_finished(const std::vector<int> &wjobs_pid) {
job_t *j;
for (auto pid : wjobs_pid) {
if ((j = job_get_from_pid(pid))) {
@ -77,7 +77,7 @@ static bool all_specified_jobs_finished(std::vector<int> wjobs_pid) {
return true;
}
static bool any_specified_jobs_finished(std::vector<int> wjobs_pid) {
static bool any_specified_jobs_finished(const std::vector<int> &wjobs_pid) {
job_t *j;
for (auto pid : wjobs_pid) {
if ((j = job_get_from_pid(pid))) {
@ -93,7 +93,7 @@ static bool any_specified_jobs_finished(std::vector<int> wjobs_pid) {
return false;
}
static void wait_for_backgrounds_specified(std::vector<int> wjobs_pid, bool any_flag) {
static void wait_for_backgrounds_specified(const std::vector<int> &wjobs_pid, bool any_flag) {
while ((!any_flag && !all_specified_jobs_finished(wjobs_pid)) ||
(any_flag && !any_specified_jobs_finished(wjobs_pid))) {
pid_t pid = proc_wait_any();