Skip to content

Commit

Permalink
Merge pull request #5436 from edwintorok/private/edvint/sdk-fix-c-build
Browse files Browse the repository at this point in the history
  • Loading branch information
psafont authored Mar 4, 2024
2 parents 0605d24 + 0008395 commit 819ccac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ 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
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 @@ -387,7 +387,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 819ccac

Please sign in to comment.