From e6583300e6e7bce05a88331c1985011b762f1866 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Sun, 2 Jul 2017 22:46:23 +0200 Subject: [PATCH] haiku: Fixed using wrong constant for internal error handling. SDL_CreateWindow() worked because ENOMEM is negative on Haiku. --- src/video/haiku/SDL_bwindow.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/video/haiku/SDL_bwindow.cc b/src/video/haiku/SDL_bwindow.cc index 026b8d90576b3..a2e96163136fa 100644 --- a/src/video/haiku/SDL_bwindow.cc +++ b/src/video/haiku/SDL_bwindow.cc @@ -66,7 +66,7 @@ static int _InitWindow(_THIS, SDL_Window *window) { SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, look, flags); if(bwin == NULL) - return ENOMEM; + return -1; window->driverdata = bwin; int32 winID = _GetBeApp()->GetID(window); @@ -76,8 +76,9 @@ static int _InitWindow(_THIS, SDL_Window *window) { } int BE_CreateWindow(_THIS, SDL_Window *window) { - if(_InitWindow(_this, window) == ENOMEM) - return ENOMEM; + if (_InitWindow(_this, window) < 0) { + return -1; + } /* Start window loop */ _ToBeWin(window)->Show(); @@ -102,8 +103,9 @@ int BE_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { } /* If we are out of memory, return the error code */ - if(_InitWindow(_this, window) == ENOMEM) - return ENOMEM; + if (_InitWindow(_this, window) < 0) { + return -1; + } /* TODO: Add any other SDL-supported window attributes here */ _ToBeWin(window)->SetTitle(otherBWin->Title());