Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown node type: 'DLLImportAttr 0x23f806baea8 <col:18>' #799

Open
silbinarywolf opened this issue Sep 30, 2018 · 3 comments
Open

unknown node type: 'DLLImportAttr 0x23f806baea8 <col:18>' #799

silbinarywolf opened this issue Sep 30, 2018 · 3 comments

Comments

@silbinarywolf
Copy link

silbinarywolf commented Sep 30, 2018

Operating system

  • Windows 10

What I did
I added a #define _GLFW_WIN32 to win32_init to workaround the #error pragma throwing and then got the following error.

c2go transpile glfw/src/win32_init.c
panic: unknown node type: 'DLLImportAttr 0x1a818906e98 <col:18>'

goroutine 28 [running]:
github.com/elliotchance/c2go/ast.Parse(0xc0016a5258, 0x24, 0x6af74c, 0x5)
        D:/GoProjects/src/github.com/elliotchance/c2go/ast/ast.go:270 +0x431b
main.convertLinesToNodes(0xc0005df650, 0x47b3, 0x8f66, 0x0, 0x0, 0x0)
        D:/GoProjects/src/github.com/elliotchance/c2go/main.go:89 +0x1d6
main.convertLinesToNodesParallel.func1.1(0xc00004a240, 0xc000006008, 0xc0005df650, 0x47b3, 0x8f66, 0x0)
        D:/GoProjects/src/github.com/elliotchance/c2go/main.go:113 +0x60
created by main.convertLinesToNodesParallel.func1
        D:/GoProjects/src/github.com/elliotchance/c2go/main.go:111 +0x119

Source: https://github.com/go-gl/glfw/blob/master/v3.2/glfw/glfw/src/win32_init.c

What I'm trying to achieve
Im experimenting with this tool to see how feasible it is to remove cgo from the go-gl packages gl and glfw.

go-gl/gl#109

@elliotchance
Copy link
Owner

This is because we haven't done very much testing against windows and you have discovered a new AST node type that c2go doesn't know how to handle.

Here is an example of how to fix it: #773

@silbinarywolf
Copy link
Author

Thanks for the example, I might have a poke around and play with this sometime this week!

@Konstantin8105
Copy link
Contributor

Dear @silbinarywolf ,
Please try project https://github.com/Konstantin8105/c4go

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

No branches or pull requests

3 participants