haiku: Fixed using wrong constant for internal error handling.
authorPhilipp Wiesemann
Sun, 02 Jul 2017 22:46:23 +0200
changeset 1112393de4d56b1b8
parent 11122 667256976a21
child 11124 c34b4e65e5f2
haiku: Fixed using wrong constant for internal error handling.

SDL_CreateWindow() worked because ENOMEM is negative on Haiku.
src/video/haiku/SDL_bwindow.cc
     1.1 --- a/src/video/haiku/SDL_bwindow.cc	Sun Jul 02 22:46:00 2017 +0200
     1.2 +++ b/src/video/haiku/SDL_bwindow.cc	Sun Jul 02 22:46:23 2017 +0200
     1.3 @@ -66,7 +66,7 @@
     1.4  
     1.5      SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, look, flags);
     1.6      if(bwin == NULL)
     1.7 -    	return ENOMEM;
     1.8 +        return -1;
     1.9  
    1.10      window->driverdata = bwin;
    1.11      int32 winID = _GetBeApp()->GetID(window);
    1.12 @@ -76,8 +76,9 @@
    1.13  }
    1.14  
    1.15  int BE_CreateWindow(_THIS, SDL_Window *window) {
    1.16 -	if(_InitWindow(_this, window) == ENOMEM)
    1.17 -		return ENOMEM;
    1.18 +    if (_InitWindow(_this, window) < 0) {
    1.19 +        return -1;
    1.20 +    }
    1.21  	
    1.22  	/* Start window loop */
    1.23      _ToBeWin(window)->Show();
    1.24 @@ -102,8 +103,9 @@
    1.25  	}
    1.26  	
    1.27  	/* If we are out of memory, return the error code */
    1.28 -	if(_InitWindow(_this, window) == ENOMEM)
    1.29 -		return ENOMEM;
    1.30 +    if (_InitWindow(_this, window) < 0) {
    1.31 +        return -1;
    1.32 +    }
    1.33  	
    1.34  	/* TODO: Add any other SDL-supported window attributes here */
    1.35      _ToBeWin(window)->SetTitle(otherBWin->Title());