Fix -Wundef warnings due to use of unguarded SDL_VIDEO_DRIVER_HAIKU

This commit is contained in:
Anonymous Maarten committed 2023-03-28 19:29:43 +02:00
1 parent 20d395d9bc
commit 8bfaa70582
12 files changed
+20 -20

No files matched your search

+4 -4
View File
@@ -82,7 +82,7 @@ static VideoBootStrap *bootstrap[] = {
#ifdef SDL_VIDEO_DRIVER_WINRT #ifdef SDL_VIDEO_DRIVER_WINRT
&WINRT_bootstrap, &WINRT_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
&HAIKU_bootstrap, &HAIKU_bootstrap,
#endif #endif
#ifdef SDL_VIDEO_DRIVER_UIKIT #ifdef SDL_VIDEO_DRIVER_UIKIT
@@ -4671,7 +4671,7 @@ int SDL_GetMessageBoxCount(void)
#if SDL_VIDEO_DRIVER_X11 #if SDL_VIDEO_DRIVER_X11
#include "x11/SDL_x11messagebox.h" #include "x11/SDL_x11messagebox.h"
#endif #endif
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
#include "haiku/SDL_bmessagebox.h" #include "haiku/SDL_bmessagebox.h"
#endif #endif
#if SDL_VIDEO_DRIVER_RISCOS #if SDL_VIDEO_DRIVER_RISCOS
@@ -4681,7 +4681,7 @@ int SDL_GetMessageBoxCount(void)
#include "vita/SDL_vitamessagebox.h" #include "vita/SDL_vitamessagebox.h"
#endif #endif
#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) || defined(SDL_VIDEO_DRIVER_COCOA) || defined(SDL_VIDEO_DRIVER_UIKIT) || SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_WAYLAND || SDL_VIDEO_DRIVER_HAIKU || SDL_VIDEO_DRIVER_RISCOS #if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) || defined(SDL_VIDEO_DRIVER_COCOA) || defined(SDL_VIDEO_DRIVER_UIKIT) || SDL_VIDEO_DRIVER_X11 || SDL_VIDEO_DRIVER_WAYLAND || defined(SDL_VIDEO_DRIVER_HAIKU) || SDL_VIDEO_DRIVER_RISCOS
static SDL_bool SDL_IsMessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype) static SDL_bool SDL_IsMessageboxValidForDriver(const SDL_MessageBoxData *messageboxdata, SDL_SYSWM_TYPE drivertype)
{ {
SDL_SysWMinfo info; SDL_SysWMinfo info;
@@ -4788,7 +4788,7 @@ int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
retval = 0; retval = 0;
} }
#endif #endif
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
if (retval == -1 && if (retval == -1 &&
SDL_IsMessageboxValidForDriver(messageboxdata, SDL_SYSWM_HAIKU) && SDL_IsMessageboxValidForDriver(messageboxdata, SDL_SYSWM_HAIKU) &&
HAIKU_ShowMessageBox(messageboxdata, buttonid) == 0) { HAIKU_ShowMessageBox(messageboxdata, buttonid) == 0) {
+6 -6
View File
@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
/* BWindow based clipboard implementation */ /* BWindow based clipboard implementation */
@@ -52,7 +52,7 @@ int HAIKU_SetClipboardText(_THIS, const char *text) {
char *HAIKU_GetClipboardText(_THIS) { char *HAIKU_GetClipboardText(_THIS) {
BMessage *clip = NULL; BMessage *clip = NULL;
const char *text = NULL; const char *text = NULL;
ssize_t length; ssize_t length;
char *result; char *result;
if (be_clipboard->Lock()) { if (be_clipboard->Lock()) {
@@ -62,8 +62,8 @@ char *HAIKU_GetClipboardText(_THIS) {
&length); &length);
} }
be_clipboard->Unlock(); be_clipboard->Unlock();
} }
if (text == NULL) { if (text == NULL) {
result = SDL_strdup(""); result = SDL_strdup("");
} else { } else {
@@ -71,7 +71,7 @@ char *HAIKU_GetClipboardText(_THIS) {
result = (char *)SDL_malloc((length + 1) * sizeof(char)); result = (char *)SDL_malloc((length + 1) * sizeof(char));
SDL_strlcpy(result, text, length + 1); SDL_strlcpy(result, text, length + 1);
} }
return result; return result;
} }
@@ -81,7 +81,7 @@ SDL_bool HAIKU_HasClipboardText(_THIS) {
if (text) { if (text) {
result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE; result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
SDL_free(text); SDL_free(text);
} }
return result; return result;
} }
+1 -1
View File
@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
#include "SDL_bevents.h" #include "SDL_bevents.h"
+1 -1
View File
@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
#include "SDL_bframebuffer.h" #include "SDL_bframebuffer.h"
+1 -1
View File
@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
#include <SupportDefs.h> #include <SupportDefs.h>
#include <support/UTF8.h> #include <support/UTF8.h>
+1 -1
View File
@@ -22,7 +22,7 @@
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
/* For application signature. */ /* For application signature. */
+1 -1
View File
@@ -25,7 +25,7 @@
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
+1 -1
View File
@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
#include <AppKit.h> #include <AppKit.h>
#include <InterfaceKit.h> #include <InterfaceKit.h>
+1 -1
View File
@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL #if defined(SDL_VIDEO_DRIVER_HAIKU) && SDL_VIDEO_OPENGL
#include "SDL_bopengl.h" #include "SDL_bopengl.h"
+1 -1
View File
@@ -22,7 +22,7 @@
#ifndef SDL_BOPENGL_H #ifndef SDL_BOPENGL_H
#define SDL_BOPENGL_H #define SDL_BOPENGL_H
#if SDL_VIDEO_DRIVER_HAIKU && SDL_VIDEO_OPENGL #if defined(SDL_VIDEO_DRIVER_HAIKU) && SDL_VIDEO_OPENGL
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
+1 -1
View File
@@ -22,7 +22,7 @@
#include "SDL_internal.h" #include "SDL_internal.h"
#include "../../core/haiku/SDL_BApp.h" #include "../../core/haiku/SDL_BApp.h"
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
#include "SDL_BWin.h" #include "SDL_BWin.h"
#include <Url.h> #include <Url.h>
+1 -1
View File
@@ -20,7 +20,7 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
#if SDL_VIDEO_DRIVER_HAIKU #ifdef SDL_VIDEO_DRIVER_HAIKU
#include "../SDL_sysvideo.h" #include "../SDL_sysvideo.h"
#include "SDL_BWin.h" #include "SDL_BWin.h"