summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrexim <reximkut@gmail.com>2024-03-28 03:07:12 +0700
committerrexim <reximkut@gmail.com>2024-03-28 03:07:12 +0700
commitbf720c8df3c3c5b2e30d79787d228803ae7a9bb6 (patch)
tree3f2e43933293229381f02bf321e1c20987e0fcd7
parent3f6497ed54793262a25c351b6ef2e50f82064afe (diff)
Try to make the game compilable on super old gcc
-rwxr-xr-xbuild-linux.sh2
-rw-r--r--raylib.ads20
2 files changed, 13 insertions, 9 deletions
diff --git a/build-linux.sh b/build-linux.sh
index 2daa077..9a81500 100755
--- a/build-linux.sh
+++ b/build-linux.sh
@@ -2,7 +2,7 @@
set -xe
-gnatmake -f -O3 -Wall -Wextra -gnat2012 eepers.adb -bargs -static -largs -L./raylib/raylib-5.0_linux_amd64/lib/ -l:libraylib.a -lm
+gnatmake -f -O3 -Wall -Wextra -gnat2012 eepers.adb -pthread -bargs -static -largs -L./raylib/raylib-5.0_linux_amd64/lib/ -l:libraylib.a -lm
./eepers
# gnatmake -f -Wall -Wextra -gnat2022 test.adb -largs -L./raylib/raylib-5.0_linux_amd64/lib/ -l:libraylib.a -lm
diff --git a/raylib.ads b/raylib.ads
index 0ba7384..74e6eac 100644
--- a/raylib.ads
+++ b/raylib.ads
@@ -3,6 +3,10 @@ with Interfaces.C.Strings; use Interfaces.C.Strings;
with Raymath; use Raymath;
package Raylib is
+ -- NOTE: some older versions of GNAT don't have C_bool, so we are defining ours
+ type Bool is new Boolean;
+ pragma Convention (C, Bool);
+
procedure Init_Window(Width, Height: int; Title: in char_array)
with
Import => True,
@@ -13,7 +17,7 @@ package Raylib is
Import => True,
Convention => C,
External_Name => "CloseWindow";
- function Window_Should_Close return C_Bool
+ function Window_Should_Close return Bool
with
Import => True,
Convention => C,
@@ -81,12 +85,12 @@ package Raylib is
KEY_LEFT_SHIFT: constant Int := 340;
KEY_RIGHT_SHIFT: constant Int := 344;
- function Is_Key_Pressed(key: int) return C_bool
+ function Is_Key_Pressed(key: int) return bool
with
Import => True,
Convention => C,
External_Name => "IsKeyPressed";
- function Is_Key_Released(key: int) return C_bool
+ function Is_Key_Released(key: int) return bool
with
Import => True,
Convention => C,
@@ -145,7 +149,7 @@ package Raylib is
Import => True,
Convention => C,
External_Name => "DrawCircleV";
- function Is_Key_Down(Key: int) return C_Bool
+ function Is_Key_Down(Key: int) return Bool
with
Import => True,
Convention => C,
@@ -214,7 +218,7 @@ package Raylib is
Import => True,
Convention => C,
External_Name => "GenImageColor";
- function Export_Image(Img: Image; File_Name: Char_Array) return C_Bool
+ function Export_Image(Img: Image; File_Name: Char_Array) return Bool
with
Import => True,
Convention => C,
@@ -239,7 +243,7 @@ package Raylib is
Import => True,
Convention => C,
External_Name => "GetApplicationDirectory";
- function Change_Directory(dir: chars_ptr) return C_Bool
+ function Change_Directory(dir: chars_ptr) return Bool
with
Import => True,
Convention => C,
@@ -263,7 +267,7 @@ package Raylib is
type Music is record
Stream: Audio_Stream;
Frame_Count: unsigned;
- Looping: C_Bool;
+ Looping: Bool;
Ctx_Type: Int;
Ctx_Data: Addr;
end record
@@ -289,7 +293,7 @@ package Raylib is
Import => True,
Convention => C,
External_Name => "StopMusicStream";
- function Is_Music_Stream_Playing(M: Music) return C_Bool
+ function Is_Music_Stream_Playing(M: Music) return Bool
with
Import => True,
Convention => C,