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

Allow Haiku build #2359

Merged
merged 1 commit into from Sep 30, 2020
Merged

Allow Haiku build #2359

merged 1 commit into from Sep 30, 2020

Conversation

kwyxz
Copy link
Contributor

@kwyxz kwyxz commented Sep 26, 2020

This allows building the EasyRPG core on Haiku.

@Ghabry
Copy link
Member

Ghabry commented Sep 26, 2020

I guess the problem is that DT_DIR is not defined or what is the compiler error?

Please do it like for PSP2: add the guard to line 163 and add your code to the function at line 186.

You are calling stat again. Is really necessary? Please check the directory entry structure of the haiku system if it provides anything useful concerning the file type.

Copy link
Member

@Ghabry Ghabry left a comment

@kwyxz
Copy link
Contributor Author

kwyxz commented Sep 26, 2020

I guess the problem is that DT_DIR is not defined or what is the compiler error?

The issue is d_type is not POSIX and does not exist on Haiku. I'll look at how it's done for PSP2.

@fdelapena fdelapena added libretro Libretro port related, including RetroArch, RetroPie and related projects Building and removed libretro Libretro port related, including RetroArch, RetroPie and related projects labels Sep 28, 2020
@Ghabry
Copy link
Member

Ghabry commented Sep 28, 2020

@kwyxz

Can you try this much simpler patch? It should make the compiler happy.
In theory this should work. The values of the macro doesn't matter when there is no .d_type.
We already have a codepath that calls stat when .d_type is missing.

diff --git a/src/platform.cpp b/src/platform.cpp
index 181058ca..0c105b80 100644
--- a/src/platform.cpp
+++ b/src/platform.cpp
@@ -21,6 +21,16 @@
 #include <cassert>
 #include <utility>
 
+#ifndef DT_UNKNOWN
+#define DT_UNKNOWN 0
+#endif
+#ifndef DT_REG
+#define DT_REG DT_UNKNOWN
+#endif
+#ifndef DT_DIR
+#define DT_DIR DT_UNKNOWN
+#endif
+
 Platform::File::File(std::string name) :
 #ifdef _WIN32
 		filename(Utils::ToWideString(name))

@Ghabry Ghabry added this to the 0.6.3 milestone Sep 28, 2020
@Ghabry Ghabry changed the title Allow Haiku build of libretro core Allow Haiku build Sep 29, 2020
@kwyxz
Copy link
Contributor Author

kwyxz commented Sep 29, 2020

Thank you for the suggestion, it builds fine.

@Ghabry
Copy link
Member

Ghabry commented Sep 29, 2020

Jenkins: Test this please

Ghabry
Ghabry approved these changes Sep 29, 2020
Copy link
Member

@Ghabry Ghabry left a comment

I squashed the other non-relevant commits away and only left the last working one.

@Ghabry Ghabry added the backport to stable Pull requests with changes backported to our stable, maintenance branch label Sep 29, 2020
@Ghabry Ghabry merged commit f73bcb0 into EasyRPG:master Sep 30, 2020
7 checks passed
@Ghabry
Copy link
Member

Ghabry commented Sep 30, 2020

@kwyxz
I picked this one for the next "stable" release (0.6.2.3 https://github.com/EasyRPG/Player/tree/0-6-2-stable). When it is released in ca. one week you can use it (but of course you can also continue using the "master" branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport to stable Pull requests with changes backported to our stable, maintenance branch Building
Development

Successfully merging this pull request may close these issues.

None yet

4 participants