Skip to content

Conversation

judah-caruso
Copy link

What issue is this addressing?

Closes #237

What type of issue is this addressing?

Feature

What this PR does | solves

Adds struct parameter and return support for Windows (amd64)

@judah-caruso
Copy link
Author

My first implementation failed, but this was the first step to get things building/testable. I'll give it a second go tomorrow with fresh eyes

Copy link
Collaborator

@TotallyGamerJet TotallyGamerJet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you're still working on this but wanted to leave some comments to help

"testing"
"unsafe"

"github.com/ebitengine/purego"
"github.com/ebitengine/purego/internal/load"
)

func getSystemLibrary() (string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can stay here instead of moving it to a separate file

@@ -186,41 +162,3 @@ func TestABI(t *testing.T) {
}
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also keep this here and just modify it to support windows. The reason is it is also used by Linux so if it's pulled out it'd create another file which isn't necessary

@@ -3,43 +3,52 @@

#include "stdint.h"

#if defined(__x86_64__) || defined(__aarch64__)
#if defined(__x86_64__) || defined(__aarch64__) || defined(_WIN32)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why specifically add the windows check is it not x86 or arm?

// Empty is empty
struct Empty {};
struct Empty;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the braces?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Struct support for Windows
3 participants