From b3ada78c1864def5dee7963839c1f39be4aa5c3d Mon Sep 17 00:00:00 2001 From: IsaacShelton Date: Mon, 18 Oct 2021 11:44:26 -0500 Subject: [PATCH] Fix build issues when using x86_64-w64-mingw32 --- Makefile | 4 ++-- include/UTIL/ground.h | 1 + src/AST/ast_layout.c | 1 + src/INFER/infer.c | 8 -------- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index b295a832..1ed5c8dd 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # Whether to include support for built-in adept package manager # NOTE: Requires libcurl fields to be filled out # NOTE: Default is 'true' -ENABLE_ADEPT_PACKAGE_MANAGER=true +ENABLE_ADEPT_PACKAGE_MANAGER=false # --------------------------- Change These Values --------------------------- # NOTE: For Windows, ensure mingw32-make.exe uses cmd.exe for shell @@ -336,7 +336,7 @@ ifeq ($(OS), Windows_NT) @del obj\*.* /S /Q 1> nul 2>&1 @del bin\adept.exe /S /Q 1> nul 2>&1 @del bin\adept_debug.exe /S /Q 1> nul 2>&1 - @del unittests\obj\*.* /S /Q 1> nul 2>&1 + @if exist unittests\obj @del unittests\obj\*.* /S /Q 1> nul 2>&1 else @find . -name "*.o" -type f -delete 2> /dev/null @rm -rf 2> /dev/null bin/adept diff --git a/include/UTIL/ground.h b/include/UTIL/ground.h index 9dfe928d..40f51837 100644 --- a/include/UTIL/ground.h +++ b/include/UTIL/ground.h @@ -19,6 +19,7 @@ extern "C" { #include #include #include +#include #ifdef _WIN32 #include diff --git a/src/AST/ast_layout.c b/src/AST/ast_layout.c index 728e1b40..10a808ff 100644 --- a/src/AST/ast_layout.c +++ b/src/AST/ast_layout.c @@ -286,6 +286,7 @@ bool ast_layout_bone_has_polymorph(ast_layout_bone_t *bone){ default: internalerrorprintf("ast_layout_bone_has_polymorph() got unknown bone kind\n"); } + return false; } strong_cstr_t ast_layout_bone_str(ast_layout_bone_t *bone, ast_field_map_t *field_map, ast_layout_endpoint_t endpoint){ diff --git a/src/INFER/infer.c b/src/INFER/infer.c index e3e88baa..20d7388a 100644 --- a/src/INFER/infer.c +++ b/src/INFER/infer.c @@ -1090,7 +1090,6 @@ errorcode_t infer_type(infer_ctx_t *ctx, ast_type_t *type){ switch(elem->id){ case AST_ELEM_BASE: { weak_cstr_t base = ((ast_elem_base_t*) elem)->base; - ast_composite_t *composite; if(strcmp(base, "void") == 0 && type->elements_length > 1 && e != 0 && type->elements[e - 1]->id == AST_ELEM_POINTER){ // Substitute '*void' with 'ptr' @@ -1132,8 +1131,6 @@ errorcode_t infer_type(infer_ctx_t *ctx, ast_type_t *type){ free(cloned.elements); continue; // Don't do normal stuff that follows } - - composite = ast_composite_find_exact(ctx->ast, base); } break; case AST_ELEM_FUNC: @@ -1143,11 +1140,6 @@ errorcode_t infer_type(infer_ctx_t *ctx, ast_type_t *type){ if(infer_type(ctx, ((ast_elem_func_t*) elem)->return_type)) return FAILURE; break; case AST_ELEM_GENERIC_BASE: { - weak_cstr_t base = ((ast_elem_generic_base_t*) elem)->name; - ast_polymorphic_composite_t *poly_composite; - - poly_composite = ast_polymorphic_composite_find_exact(ctx->ast, base); - for(length_t a = 0; a != ((ast_elem_generic_base_t*) elem)->generics_length; a++){ if(infer_type(ctx, &((ast_elem_generic_base_t*) elem)->generics[a])) return FAILURE; }