Skip to content

Commit e6a089e

Browse files
authored
Fix build when Z3_API macro is non-empty (#7553)
API function definitions are updated to be consistent with header files.
1 parent d10efa6 commit e6a089e

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/api/api_array.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,15 @@ extern "C" {
282282
Z3_CATCH_RETURN(nullptr);
283283
}
284284

285-
Z3_ast Z3_mk_set_member(Z3_context c, Z3_ast elem, Z3_ast set) {
285+
Z3_ast Z3_API Z3_mk_set_member(Z3_context c, Z3_ast elem, Z3_ast set) {
286286
return Z3_mk_select(c, set, elem);
287287
}
288288

289-
Z3_ast Z3_mk_set_add(Z3_context c, Z3_ast set, Z3_ast elem) {
289+
Z3_ast Z3_API Z3_mk_set_add(Z3_context c, Z3_ast set, Z3_ast elem) {
290290
return Z3_mk_store(c, set, elem, Z3_mk_true(c));
291291
}
292292

293-
Z3_ast Z3_mk_set_del(Z3_context c, Z3_ast set, Z3_ast elem) {
293+
Z3_ast Z3_API Z3_mk_set_del(Z3_context c, Z3_ast set, Z3_ast elem) {
294294
return Z3_mk_store(c, set, elem, Z3_mk_false(c));
295295
}
296296

src/api/api_ast.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ extern "C" {
369369
Z3_CATCH_RETURN(-1);
370370
}
371371

372-
Z3_API char const * Z3_get_symbol_string(Z3_context c, Z3_symbol s) {
372+
Z3_string Z3_API Z3_get_symbol_string(Z3_context c, Z3_symbol s) {
373373
Z3_TRY;
374374
LOG_Z3_get_symbol_string(c, s);
375375
RESET_ERROR_CODE();
@@ -714,7 +714,7 @@ extern "C" {
714714
Z3_CATCH_RETURN(nullptr);
715715
}
716716

717-
Z3_sort_kind Z3_get_sort_kind(Z3_context c, Z3_sort t) {
717+
Z3_sort_kind Z3_API Z3_get_sort_kind(Z3_context c, Z3_sort t) {
718718
LOG_Z3_get_sort_kind(c, t);
719719
RESET_ERROR_CODE();
720720
CHECK_VALID_AST(t, Z3_UNKNOWN_SORT);
@@ -1019,7 +1019,7 @@ extern "C" {
10191019
Z3_CATCH_RETURN(nullptr);
10201020
}
10211021

1022-
Z3_API char const * Z3_ast_to_string(Z3_context c, Z3_ast a) {
1022+
Z3_string Z3_API Z3_ast_to_string(Z3_context c, Z3_ast a) {
10231023
Z3_TRY;
10241024
LOG_Z3_ast_to_string(c, a);
10251025
RESET_ERROR_CODE();
@@ -1045,11 +1045,11 @@ extern "C" {
10451045
Z3_CATCH_RETURN(nullptr);
10461046
}
10471047

1048-
Z3_API char const * Z3_sort_to_string(Z3_context c, Z3_sort s) {
1048+
Z3_string Z3_API Z3_sort_to_string(Z3_context c, Z3_sort s) {
10491049
return Z3_ast_to_string(c, reinterpret_cast<Z3_ast>(s));
10501050
}
10511051

1052-
Z3_API char const * Z3_func_decl_to_string(Z3_context c, Z3_func_decl f) {
1052+
Z3_string Z3_API Z3_func_decl_to_string(Z3_context c, Z3_func_decl f) {
10531053
return Z3_ast_to_string(c, reinterpret_cast<Z3_ast>(f));
10541054
}
10551055

src/api/api_context.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ extern "C" {
518518
}
519519
}
520520

521-
Z3_API char const * Z3_get_error_msg(Z3_context c, Z3_error_code err) {
521+
Z3_string Z3_API Z3_get_error_msg(Z3_context c, Z3_error_code err) {
522522
LOG_Z3_get_error_msg(c, err);
523523
return _get_error_msg(c, err);
524524
}

src/api/api_datatype.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ extern "C" {
604604
Z3_CATCH_RETURN(nullptr);
605605
}
606606

607-
Z3_ast Z3_datatype_update_field(
607+
Z3_ast Z3_API Z3_datatype_update_field(
608608
Z3_context c, Z3_func_decl f, Z3_ast t, Z3_ast v) {
609609
Z3_TRY;
610610
LOG_Z3_datatype_update_field(c, f, t, v);

src/api/api_model.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ extern "C" {
422422
Z3_CATCH_RETURN(nullptr);
423423
}
424424

425-
Z3_API char const * Z3_model_to_string(Z3_context c, Z3_model m) {
425+
Z3_string Z3_API Z3_model_to_string(Z3_context c, Z3_model m) {
426426
Z3_TRY;
427427
LOG_Z3_model_to_string(c, m);
428428
RESET_ERROR_CODE();

src/api/api_quant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ extern "C" {
575575
return (Z3_ast)(p);
576576
}
577577

578-
Z3_API char const * Z3_pattern_to_string(Z3_context c, Z3_pattern p) {
578+
Z3_string Z3_API Z3_pattern_to_string(Z3_context c, Z3_pattern p) {
579579
return Z3_ast_to_string(c, reinterpret_cast<Z3_ast>(p));
580580
}
581581

0 commit comments

Comments
 (0)