Skip to content

Commit

Permalink
Backporting Angelscript Haiku support fix.
Browse files Browse the repository at this point in the history
Fixing segfault on OpenGL extensions listing.
  • Loading branch information
devnexen committed Aug 31, 2020
1 parent 738c7e5 commit d69b75f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
14 changes: 11 additions & 3 deletions Sources/AngelScript/source/as_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1079,15 +1079,23 @@
// Haiku OS
#elif __HAIKU__
#define AS_HAIKU
// Only x86-32 is currently supported by Haiku, but they do plan to support
// x86-64 and PowerPC in the future, so should go ahead and check the platform
// for future compatibility
#if (defined(i386) || defined(__i386) || defined(__i386__)) && !defined(__LP64__)
#define AS_X86
#define THISCALL_PASS_OBJECT_POINTER_ON_THE_STACK
#define THISCALL_RETURN_SIMPLE_IN_MEMORY
#define CDECL_RETURN_SIMPLE_IN_MEMORY
#define STDCALL_RETURN_SIMPLE_IN_MEMORY
#elif defined(__x86_64__)
#define AS_X64_GCC
#define HAS_128_BIT_PRIMITIVES
#undef COMPLEX_MASK
#define COMPLEX_MASK (asOBJ_APP_CLASS_CONSTRUCTOR | asOBJ_APP_CLASS_DESTRUCTOR)
#undef COMPLEX_RETURN_MASK
#define COMPLEX_RETURN_MASK (asOBJ_APP_CLASS_CONSTRUCTOR | asOBJ_APP_CLASS_DESTRUCTOR)
#define AS_LARGE_OBJS_PASSED_BY_REF
#define AS_LARGE_OBJ_MIN_SIZE 5
#undef STDCALL
#define STDCALL
#else
#define AS_MAX_PORTABILITY
#endif
Expand Down
10 changes: 6 additions & 4 deletions Sources/Gui/StartupScreenHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,12 @@ namespace spades {
"GL_EXT_framebuffer_object",
NULL};

SPLog("--- Extensions ---");
std::vector<std::string> strs = spades::Split(str, " ");
for (size_t i = 0; i < strs.size(); i++) {
SPLog("%s", strs[i].c_str());
if (str) {
SPLog("--- Extensions ---");
std::vector<std::string> strs = spades::Split(str, " ");
for (size_t i = 0; i < strs.size(); i++) {
SPLog("%s", strs[i].c_str());
}
}
SPLog("------------------");

Expand Down

0 comments on commit d69b75f

Please sign in to comment.