Skip to content

Commit

Permalink
Updated raylib example
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacShelton committed Aug 27, 2024
1 parent 4624778 commit 02ec1e0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
6 changes: 5 additions & 1 deletion src/c/translation/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ impl TypeBaseBuilder {
let ast_type = if let Some(concrete) = self.concrete {
concrete
} else if let Some(size) = self.size {
Type::new(TypeKind::CInteger(size, self.sign), self.source)
let sign = self
.sign
.or_else(|| (!size.is_char()).then_some(IntegerSign::Signed));

Type::new(TypeKind::CInteger(size, sign), self.source)
} else if let Some(sign) = self.sign {
Type::new(TypeKind::CInteger(CInteger::Int, Some(sign)), self.source)
} else {
Expand Down
23 changes: 6 additions & 17 deletions tests/raylib/_.adept
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@

pragma => {
adept(c"3.0")

#[windows] {
link(c"libraylib.a")
return
}

#[macos] {
link(c"libraylib.a")
linkFramework(c"OpenGL")
linkFramework(c"Cocoa")
linkFramework(c"IOKit")
linkFramework(c"Foundation")
linkFramework(c"CoreFoundation")
return
}

panic("Unsupported platform")
link(c"libraylib.a")
linkFramework(c"OpenGL")
linkFramework(c"Cocoa")
linkFramework(c"IOKit")
linkFramework(c"Foundation")
linkFramework(c"CoreFoundation")
}

4 changes: 2 additions & 2 deletions tests/raylib/main.adept
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

func main {
screen_width := 800
screen_height := 450
screen_width int = 800
screen_height int = 450

InitWindow(screen_width, screen_height, c"Example Window!")

Expand Down

0 comments on commit 02ec1e0

Please sign in to comment.