From 572b22e6e6afd9e2c5229f8483d34604b00e5044 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 17 Feb 2022 01:37:33 -0600 Subject: [PATCH] Regression: Fake static compile not building. The path_sources_object should not be used for the static library sources. Skip empty data in static build. Add additional status check. Cleanup the example-objects sources. --- level_3/fake/c/private-build-objects.c | 6 ++++-- level_3/fake/c/private-build-program.c | 2 +- level_3/fake/data/projects/example-objects/sources/fake.c | 10 +++++----- level_3/fake/data/projects/example-objects/sources_object/a.c | 2 +- level_3/fake/data/projects/example-objects/sources_object/e.c | 2 +- level_3/fake/data/projects/example-objects/sources_object/f.c | 2 +- level_3/fake/data/projects/example-objects/sources_object/k.c | 2 +- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/level_3/fake/c/private-build-objects.c b/level_3/fake/c/private-build-objects.c index 60d450c..8c43639 100644 --- a/level_3/fake/c/private-build-objects.c +++ b/level_3/fake/c/private-build-objects.c @@ -52,15 +52,17 @@ extern "C" { for (j = 0; j < sources[i]->used; ++j) { + if (!sources[i]->array[j].used) continue; + file_name.used = 0; destination_path.used = 0; - fake_build_path_source_length(main, data_build, &data_build->setting.path_sources_object, &source); + fake_build_path_source_length(main, data_build, &data_build->setting.path_sources, &source); char source_string[source.used + sources[i]->array[j].used + 1]; source.string = source_string; - fake_build_path_source_string(main, data_build, &data_build->setting.path_sources_object, &source); + fake_build_path_source_string(main, data_build, &data_build->setting.path_sources, &source); memcpy(source_string + source.used, sources[i]->array[j].string, sources[i]->array[j].used); source.used += sources[i]->array[j].used; diff --git a/level_3/fake/c/private-build-program.c b/level_3/fake/c/private-build-program.c index b273e2b..40493a3 100644 --- a/level_3/fake/c/private-build-program.c +++ b/level_3/fake/c/private-build-program.c @@ -147,7 +147,7 @@ extern "C" { return 0; } - { + if (F_status_is_error_not(*status)) { f_string_static_t source_library = f_string_static_t_initialize; source_library.used = main->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used + data_build->setting.build_name.used + fake_build_parameter_library_name_suffix_static_s.used; diff --git a/level_3/fake/data/projects/example-objects/sources/fake.c b/level_3/fake/data/projects/example-objects/sources/fake.c index a7a711c..586a509 100644 --- a/level_3/fake/data/projects/example-objects/sources/fake.c +++ b/level_3/fake/data/projects/example-objects/sources/fake.c @@ -1,11 +1,11 @@ #include -extern void print_f(); -extern void print_a(); -extern void print_k(); -extern void print_e(); +extern void print_f(void); +extern void print_a(void); +extern void print_k(void); +extern void print_e(void); -int main(int argc, char *argv[]) { +int main(int argc, char *argv[], char *envp[]) { print_f(); print_a(); print_k(); diff --git a/level_3/fake/data/projects/example-objects/sources_object/a.c b/level_3/fake/data/projects/example-objects/sources_object/a.c index f053b3e..7651d7d 100644 --- a/level_3/fake/data/projects/example-objects/sources_object/a.c +++ b/level_3/fake/data/projects/example-objects/sources_object/a.c @@ -1,5 +1,5 @@ #include -void print_a() { +void print_a(void) { printf("a"); } diff --git a/level_3/fake/data/projects/example-objects/sources_object/e.c b/level_3/fake/data/projects/example-objects/sources_object/e.c index 8762738..3b6b8ed 100644 --- a/level_3/fake/data/projects/example-objects/sources_object/e.c +++ b/level_3/fake/data/projects/example-objects/sources_object/e.c @@ -1,5 +1,5 @@ #include -void print_e() { +void print_e(void) { printf("e"); } diff --git a/level_3/fake/data/projects/example-objects/sources_object/f.c b/level_3/fake/data/projects/example-objects/sources_object/f.c index 19478bb..bde9896 100644 --- a/level_3/fake/data/projects/example-objects/sources_object/f.c +++ b/level_3/fake/data/projects/example-objects/sources_object/f.c @@ -1,5 +1,5 @@ #include -void print_f() { +void print_f(void) { printf("f"); } diff --git a/level_3/fake/data/projects/example-objects/sources_object/k.c b/level_3/fake/data/projects/example-objects/sources_object/k.c index 7cc15b8..4a4d986 100644 --- a/level_3/fake/data/projects/example-objects/sources_object/k.c +++ b/level_3/fake/data/projects/example-objects/sources_object/k.c @@ -1,5 +1,5 @@ #include -void print_k() { +void print_k(void) { printf("k"); } -- 1.8.3.1