Skip to content

Commit 027b9e4

Browse files
committed
Haiku "build" fix
1 parent 71195e6 commit 027b9e4

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/utils.cc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
#include <SDL2/SDL_pixels.h> // for SDL_PIXELFORMAT_ARGB8888
3333
#include <SDL2/SDL_surface.h> // for SDL_CreateRGBSurface, SDL_FreeSurface
3434

35+
#ifdef __HAIKU__
36+
#include <FindDirectory.h>
37+
#include <Path.h>
38+
#endif
39+
3540
#include "config.h"
3641
#include "utils.h"
3742
#include "preference.h"
@@ -152,7 +157,7 @@ bool Utils::SaveFile(const char *Path, char *Buf, long L)
152157

153158
/*** Met le bon chemin pour charger un fichier ***/
154159
/*************************************************/
155-
#if (defined(__unix__) || defined(ANDROID)) && !defined(__AMIGAOS4__)
160+
#if (defined(__unix__) || defined(ANDROID)) && !defined(__HAIKU__) && !defined(__AMIGAOS4__)
156161
// Version Linux
157162
void Utils::GetPath(char *Path)
158163
{
@@ -220,6 +225,24 @@ void Utils::GetPath(char *Path)
220225
}
221226
#endif
222227

228+
#ifdef __HAIKU__
229+
// Version Haiku
230+
void Utils::GetPath(char *Path)
231+
{
232+
char Provi[512];
233+
234+
strcpy(Provi, Path);
235+
236+
sprintf(Path, "%s/%s", LIRI_DATA_DIR, Provi);
237+
if(Utils::FileExists(Path)) {
238+
return;
239+
}
240+
241+
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find '%s'", Path);
242+
exit(-1);
243+
}
244+
#endif
245+
223246
#ifdef _WIN32
224247
// Version Windows , chemin directe
225248
void Utils::GetPath(char *Path)

0 commit comments

Comments
 (0)