Advertisement
Guest User

Untitled

a guest
May 28th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. // make sure you have GLFW3 installed on your system
  2. // run: zig build-exe -isystem /usr/include main.zig
  3.  
  4.  
  5. pub use @cImport({
  6. @cInclude("GLFW/glfw3.h");
  7. });
  8.  
  9. const Tetris = struct {
  10. y : u8
  11. };
  12.  
  13. var tetris_state: Tetris = undefined;
  14.  
  15. pub fn main() void {
  16. const t = &tetris_state;
  17.  
  18. glfwSetWindowUserPointer(null, @ptrCast(*c_void, t));
  19. }
  20.  
  21. // Following error occurs:
  22. // Call parameter type does not match function signature!
  23. // %Tetris* @tetris_state
  24. // i8* call void @glfwSetWindowUserPointer(i8* null, %Tetris* @tetris_state), !dbg !12618
  25. // LLVM ERROR: Broken module found, compilation aborted!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement