Skip to content

Commit

Permalink
Add static windows build, fix cur windows CI (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
eisenhauer authored Feb 7, 2024
1 parent e8989c2 commit fe11875
Show file tree
Hide file tree
Showing 20 changed files with 374 additions and 660 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,15 @@ jobs:
jobname: [
windows2019-vs2019-clang,
windows2022-vs2022-msvc,
windows2022-vs2022-msvc-static,
macos-clang ]
include:
- jobname: windows2019-vs2019-clang
vm: windows-2019
- jobname: windows2022-vs2022-msvc
vm: windows-2022
- jobname: windows2022-vs2022-msvc-static
vm: windows-2022
- jobname: macos-clang
vm: macos-latest

Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ add_custom_command(

add_custom_target(docs ALL DEPENDS "cod_node.c")

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
SET_SOURCE_FILES_PROPERTIES(cod.tab.c PROPERTIES COMPILE_FLAGS -Wno-unused-function)
endif()

add_custom_target(generated DEPENDS cod_node.c ${BISON_CODParser_OUTPUT_SOURCE})

list(APPEND COD_MASTER_SRC_LIST
Expand Down
4 changes: 4 additions & 0 deletions cod/cg.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ cg_required_align(dill_stream s, sm_ref node)
required_align = dill_type_align(s, DILL_P);
break;
default:
required_align = 0; //silence warning
assert(0);
}
return required_align;
Expand Down Expand Up @@ -1750,6 +1751,7 @@ execute_operator_cg(dill_stream s, operator_t op, int op_type, dill_reg result,
} else if (typ->node_type == cod_array_type_decl) {
size = typ->node.array_type_decl.cg_element_size;
} else {
size = 1; // avoid warning
assert(0);
}
} else if ((ptr->node_type == cod_operator) && (ptr->node.operator.op == op_address)) {
Expand All @@ -1758,6 +1760,7 @@ execute_operator_cg(dill_stream s, operator_t op, int op_type, dill_reg result,
if (cod_expr_is_string(ptr)) {
size = 1;
} else {
size = 1; // silence warning
assert(FALSE);
}
}
Expand Down Expand Up @@ -1898,6 +1901,7 @@ execute_operator_cg(dill_stream s, operator_t op, int op_type, dill_reg result,
if (cod_expr_is_string(ptr)) {
size = 1;
} else {
size = 1; // avoid warning
assert(FALSE);
}
}
Expand Down
4 changes: 2 additions & 2 deletions cod/cod.y
Original file line number Diff line number Diff line change
Expand Up @@ -6447,7 +6447,7 @@ space_to_underscore(char *str){
while(*str != '\0'){
if(isspace(*str))
*str = '_';
str++;
str++;
}
}

Expand Down Expand Up @@ -6732,7 +6732,7 @@ evaluate_constant_return_expr(cod_parse_context context, sm_ref expr, int *free_
*free_result = 1;
} else {
/* we get an integer result */
intptr_t left_val = 0, right_val = 0, value;
intptr_t left_val = 0, right_val = 0, value = 0;
char str_val[40];
if (expr->node.operator.left)
left_val = get_constant_long_value(context, left);
Expand Down
63 changes: 0 additions & 63 deletions cod/pregen_source/Windows/cod.l
Original file line number Diff line number Diff line change
Expand Up @@ -359,70 +359,9 @@ yywrap YY_PROTO(( void ))
}


#ifndef input
/* flex, not lex */
void yy_delete_buffer YY_PROTO((YY_BUFFER_STATE b));

#ifdef WINNT
/* old Windows code for MKS Toolkit version of flex */

static void
terminate_string_parse()
{
yyrestart(NULL);
}

#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( yy_size_t size )
#else
static void *yy_flex_alloc( size )
yy_size_t size;
#endif
{
return (void *) malloc( size );
}

static char* current_input_string;

int my_yy_input(buf,result,max_size) {

if (current_input_string == NULL)
{

result = 0;
}
else
if (max_size < strlen(current_input_string))
{
memcpy((void*)buf, current_input_string, max_size);
current_input_string += max_size;
result = max_size;
} else {
int n = strlen(current_input_string);
memcpy((void*)buf, current_input_string, n+1);
current_input_string = NULL;
result = n;
}

/* printf("my_yy_input buf[%s],result[%d]\n",buf,result);*/
return result;
}

static void
setup_for_string_parse(string, defined_types, enum_constants)
const char *string;
char **defined_types;
char **enum_constants;
{
type_count = defined_type_count;
types = defined_types;
enums = enum_constants;

current_input_string = string;
lex_offset = 1;
line_count = 1;
}
#else

static YY_BUFFER_STATE bb = NULL;

Expand Down Expand Up @@ -455,5 +394,3 @@ terminate_string_parse()
}
}

#endif
#endif
Loading

0 comments on commit fe11875

Please sign in to comment.