From c318cd56e639e4e5115d3ea127c099f90389e39a Mon Sep 17 00:00:00 2001 From: JohnnyCena123 Date: Wed, 8 Oct 2025 15:51:39 +0300 Subject: [PATCH] include `raylib.h` and `rcore.c` in platform files this has already been done in `rcore_desktop_rgfw.c`, but not perfectly as the comments state, its there for LSPs --- src/platforms/rcore_android.c | 5 +++++ src/platforms/rcore_desktop_glfw.c | 5 +++++ src/platforms/rcore_desktop_rgfw.c | 6 +++--- src/platforms/rcore_desktop_sdl.c | 5 +++++ src/platforms/rcore_drm.c | 5 +++++ src/platforms/rcore_template.c | 4 ++++ src/platforms/rcore_web.c | 5 +++++ 7 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index 6ecc41888592..15c30bb245fc 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -46,6 +46,11 @@ * **********************************************************************************************/ +#ifndef RAYLIB_H // this should never actually happen, it's only here for IDEs +#include "../raylib.h" +#include "../rcore.c" +#endif + #include // Required for: android_app struct and activity management #include // Required for: AWINDOW_FLAG_FULLSCREEN definition and others //#include // Required for: Android sensors functions (accelerometer, gyroscope, light...) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index cab497266ee9..f6a51a004766 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -49,6 +49,11 @@ * **********************************************************************************************/ +#ifndef RAYLIB_H // this should never actually happen, it's only here for IDEs + #include "../raylib.h" + #include "../rcore.c" +#endif + #define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 // NOTE: Already provided by rlgl implementation (on glad.h) #include "GLFW/glfw3.h" // GLFW3 library: Windows, OpenGL context and Input management diff --git a/src/platforms/rcore_desktop_rgfw.c b/src/platforms/rcore_desktop_rgfw.c index f2e2a7407f3c..40c29f3f82de 100644 --- a/src/platforms/rcore_desktop_rgfw.c +++ b/src/platforms/rcore_desktop_rgfw.c @@ -48,9 +48,9 @@ * **********************************************************************************************/ -#ifndef RAYLIB_H /* this should never actually happen, it's only here for IDEs */ -#include "raylib.h" -#include "../rcore.c" +#ifndef RAYLIB_H // this should never actually happen, it's only here for IDEs + #include "../raylib.h" + #include "../rcore.c" #endif #if defined(PLATFORM_WEB_RGFW) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 71265e718d22..ffe4f40a188d 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -48,6 +48,11 @@ * **********************************************************************************************/ +#ifndef RAYLIB_H // this should never actually happen, it's only here for IDEs + #include "../raylib.h" + #include "../rcore.c" +#endif + #ifdef USING_SDL3_PACKAGE #define USING_SDL3_PROJECT #endif diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index a399092ad96a..dcef0e2efb8b 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -48,6 +48,11 @@ * **********************************************************************************************/ +#ifndef RAYLIB_H // this should never actually happen, it's only here for IDEs + #include "../raylib.h" + #include "../rcore.c" +#endif + #include // POSIX file control definitions - open(), creat(), fcntl() #include // POSIX standard function definitions - read(), close(), STDIN_FILENO #include // POSIX terminal control definitions - tcgetattr(), tcsetattr() diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index 36629fc69d78..c82c466c7707 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -47,6 +47,10 @@ **********************************************************************************************/ // TODO: Include the platform specific libraries +#ifndef RAYLIB_H // this should never actually happen, it's only here for IDEs + #include "../raylib.h" + #include "../rcore.c" +#endif //---------------------------------------------------------------------------------- // Types and Structures Definition diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index c8fe0cfe7f94..c3bdef882435 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -45,6 +45,11 @@ * **********************************************************************************************/ +#ifndef RAYLIB_H // this should never actually happen, it's only here for IDEs + #include "../raylib.h" + #include "../rcore.c" +#endif + #define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 // NOTE: Already provided by rlgl implementation (on glad.h) #include "GLFW/glfw3.h" // GLFW3: Windows, OpenGL context and Input management