Skip to content

Commit

Permalink
Merge pull request #5547 from danilo-delbusso/dev/port-fedora-fix
Browse files Browse the repository at this point in the history
Port of "Fix C SDK build on Fedora39" to `master`
  • Loading branch information
kc284 authored Apr 8, 2024
2 parents ec36f8b + 484b098 commit f106b8f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ sdk:
sh ocaml/sdk-gen/windows-line-endings.sh $(XAPISDK)/csharp
sh ocaml/sdk-gen/windows-line-endings.sh $(XAPISDK)/powershell

.PHONY: sdk-build-c sdk sdksanity

sdk-build-c: sdk
cd _build/install/default/xapi/sdk/c && make -j $(JOBS)

# workaround for no .resx generation, just for compilation testing
sdksanity: sdk
sed -i 's/FriendlyErrorNames.ResourceManager/null/g' ./_build/install/default/xapi/sdk/csharp/src/Failure.cs
cd _build/install/default/xapi/sdk/csharp/src && dotnet add package Newtonsoft.Json && dotnet build -f netstandard2.0

.PHONY: sdk-build-java

sdk-build-java: sdk
Expand Down
21 changes: 4 additions & 17 deletions ocaml/sdk-gen/c/autogen/src/xen_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,7 @@ set_api_version(xen_session *session)
void
xen_session_logout(xen_session *session)
{
abstract_value params[] =
{
};
xen_call_(session, "session.logout", params, 0, NULL, NULL);
xen_call_(session, "session.logout", NULL, 0, NULL, NULL);

if (session->error_description != NULL)
{
Expand All @@ -314,10 +311,7 @@ xen_session_logout(xen_session *session)
void
xen_session_local_logout(xen_session *session)
{
abstract_value params[] =
{
};
xen_call_(session, "session.local_logout", params, 0, NULL, NULL);
xen_call_(session, "session.local_logout", NULL, 0, NULL, NULL);

if (session->error_description != NULL)
{
Expand All @@ -336,29 +330,22 @@ xen_session_local_logout(xen_session *session)
bool
xen_session_get_all_subject_identifiers(xen_session *session, struct xen_string_set **result)
{
abstract_value params[] =
{
};

abstract_type result_type = abstract_type_string_set;

*result = NULL;
xen_call_(session, "session.get_all_subject_identifiers", params, 0, &result_type, result);
xen_call_(session, "session.get_all_subject_identifiers", NULL, 0, &result_type, result);
return session->ok;
}


bool
xen_session_get_all_subject_identifiers_async(xen_session *session, xen_task *result)
{
abstract_value params[] =
{
};

abstract_type result_type = abstract_type_string;

*result = NULL;
xen_call_(session, "Async.session.get_all_subject_identifiers", params, 0, &result_type, result);
xen_call_(session, "Async.session.get_all_subject_identifiers", NULL, 0, &result_type, result);
return session->ok;
}

Expand Down
4 changes: 3 additions & 1 deletion ocaml/sdk-gen/c/gen_c_binding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ and impl_message needed classname message =
sprintf
" xen_call_(session, \"%s.%s\", %s, %d, NULL, NULL);\n\
\ return session->ok;\n"
classname message.msg_name param_call param_count
classname message.msg_name
(if param_count = 0 then "NULL" else param_call)
param_count
in

let messageAsyncImpl = impl_message_async needed classname message in
Expand Down

0 comments on commit f106b8f

Please sign in to comment.