Standardize SDL2 include

This commit is contained in:
Marcus Minhorst 2025-09-20 20:51:21 -04:00 committed by Rachael Alexanderson
commit 1ce47e2fec
10 changed files with 50 additions and 54 deletions

View file

@ -48,31 +48,26 @@
# SDL2_LIBRARY to override this selection or set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
#
# Note that the header path has changed from SDL2/SDL.h to just SDL.h
# This needed to change because "proper" SDL2 convention
# is #include "SDL.h", not <SDL2/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL2/ (see FreeBSD).
#
# Ported by Johnny Patterson. This is a literal port for SDL2 of the FindSDL.cmake
# module with the minor edit of changing "SDL" to "SDL2" where necessary. This
# was not created for redistribution, and exists temporarily pending official
# SDL2 CMake modules.
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
FIND_PATH(SDL2_INCLUDE_DIR SDL2/SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES include/SDL2 include
PATH_SUFFIXES include
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/include/SDL2
/usr/include/SDL2
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/homebrew
/opt
/boot/system/develop/headers/SDL2 #Haiku OS
/boot/system/develop/headers #Haiku OS
)
#MESSAGE("SDL2_INCLUDE_DIR is ${SDL2_INCLUDE_DIR}")

View file

@ -1,7 +1,7 @@
#ifndef __POSIX_SDL_GL_SYSFB_H__
#define __POSIX_SDL_GL_SYSFB_H__
#include <SDL.h>
#include <SDL2/SDL.h>
#include "v_video.h"
@ -46,4 +46,3 @@ protected:
};
#endif // __POSIX_SDL_GL_SYSFB_H__

View file

@ -4,6 +4,7 @@
**
**---------------------------------------------------------------------------
** Copyright 1998-2006 Randy Heit
** Copyright 2017-2025 GZDoom Maintainers and Contributors
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
@ -32,22 +33,21 @@
**
*/
#include <SDL.h>
#include <SDL2/SDL.h>
#include <signal.h>
#include "i_system.h"
#include "hardware.h"
#include "c_dispatch.h"
#include "v_text.h"
#include "m_argv.h"
#include "c_console.h"
#include "c_dispatch.h"
#include "hardware.h"
#include "i_system.h"
#include "m_argv.h"
#include "printf.h"
#include "v_text.h"
IVideo *Video;
void I_RestartRenderer();
void I_ShutdownGraphics ()
{
if (screen)

View file

@ -3,6 +3,7 @@
**
**---------------------------------------------------------------------------
** Copyright 2008 Randy Heit
** Copyright 2017-2025 GZDoom Maintainers and Contributors
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
@ -33,7 +34,7 @@
#include <string.h>
#include <SDL.h>
#include <SDL2/SDL.h>
#include "bitmap.h"
#include "textures.h"

View file

@ -34,8 +34,8 @@
**
*/
#include <SDL.h>
#include <SDL_events.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_events.h>
#include "c_buttons.h"
#include "c_console.h"

View file

@ -36,8 +36,8 @@
**
*/
#include <SDL.h>
#include <SDL_gamecontroller.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_gamecontroller.h>
#include <cstdint>
#include <cstdlib>

View file

@ -35,25 +35,24 @@
// HEADER FILES ------------------------------------------------------------
#include <SDL.h>
#include <unistd.h>
#include <signal.h>
#include <new>
#include <sys/param.h>
#include <SDL2/SDL.h>
#include <csignal>
#include <locale.h>
#include <new>
#include <signal.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <csignal>
#include <unistd.h>
#include "engineerrors.h"
#include "m_argv.h"
#include "c_console.h"
#include "version.h"
#include "cmdlib.h"
#include "engineerrors.h"
#include "i_system.h"
#include "i_interface.h"
#include "i_system.h"
#include "m_argv.h"
#include "printf.h"
#include "version.h"
// MACROS ------------------------------------------------------------------

View file

@ -5,6 +5,7 @@
**---------------------------------------------------------------------------
** Copyright 1999-2016 Randy Heit
** Copyright 2019-2020 Christoph Oelckers
** Copyright 2017-2025 GZDoom Maintainers and Contributors
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
@ -34,18 +35,18 @@
*/
#include <dirent.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fnmatch.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdarg.h>
#include <fcntl.h>
#include <stdarg.h>
#include <sys/ioctl.h>
#include <time.h>
#include <unistd.h>
#include <sys/ioctl.h>
#ifdef __linux__
#include <asm/unistd.h>
@ -57,19 +58,19 @@
#include <termios.h>
#endif
#include <SDL.h>
#include <SDL2/SDL.h>
#include "version.h"
#include "cmdlib.h"
#include "m_argv.h"
#include "i_sound.h"
#include "i_interface.h"
#include "v_font.h"
#include "c_cvars.h"
#include "palutil.h"
#include "st_start.h"
#include "printf.h"
#include "cmdlib.h"
#include "i_interface.h"
#include "i_sound.h"
#include "launcherwindow.h"
#include "m_argv.h"
#include "palutil.h"
#include "printf.h"
#include "st_start.h"
#include "v_font.h"
#include "version.h"
#ifndef NO_GTK
bool I_GtkAvailable ();

View file

@ -34,39 +34,40 @@
// HEADER FILES ------------------------------------------------------------
#include "c_console.h"
#include "c_dispatch.h"
#include "i_module.h"
#include "i_soundinternal.h"
#include "i_system.h"
#include "i_video.h"
#include "m_argv.h"
#include "printf.h"
#include "v_video.h"
#include "version.h"
#include "c_console.h"
#include "c_dispatch.h"
#include "printf.h"
#include "hardware.h"
#include "gl_sysfb.h"
#include "gl_system.h"
#include "hardware.h"
#include "gl_renderer.h"
#include "gl_framebuffer.h"
#include "gl_renderer.h"
#ifdef HAVE_GLES2
#include "gles_framebuffer.h"
#endif
#ifdef HAVE_VULKAN
#include "vulkan/system/vk_renderdevice.h"
#include <zvulkan/vulkanbuilders.h>
#include <zvulkan/vulkandevice.h>
#include <zvulkan/vulkaninstance.h>
#include <zvulkan/vulkansurface.h>
#include <zvulkan/vulkandevice.h>
#include <zvulkan/vulkanbuilders.h>
#endif
// MACROS ------------------------------------------------------------------
#if defined HAVE_VULKAN
#include <SDL_vulkan.h>
#include <SDL2/SDL_vulkan.h>
#endif // HAVE_VULKAN
// TYPES -------------------------------------------------------------------

View file

@ -22,7 +22,7 @@ extern FString sys_ostype;
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#else // !__APPLE__
#include <SDL.h>
#include <SDL2/SDL.h>
#endif // __APPLE__
#include <sys/socket.h>
#include <sys/types.h>