Added required includes to the platform headers .

Added missing include decelerations and in one case removed an unnecessary
one form the platform headers in the demo/ directory .
This commit is contained in:
b-aaz 2024-01-20 16:16:45 +03:30
parent f7fedf091f
commit fb474874db
24 changed files with 52 additions and 6 deletions

View File

@ -46,6 +46,7 @@ NK_API void nk_allegro5_font_set_font(NkAllegro5Font *font);
* ===============================================================
*/
#ifdef NK_ALLEGRO5_IMPLEMENTATION
#include <stdio.h>
#ifndef NK_ALLEGRO5_TEXT_MAX
#define NK_ALLEGRO5_TEXT_MAX 256

View File

@ -41,6 +41,7 @@ NK_API void nk_d3d11_shutdown(void);
#define COBJMACROS
#include <d3d11.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <float.h>

View File

@ -88,6 +88,7 @@ NK_API void nk_d3d12_shutdown(void);
#define COBJMACROS
#include <d3d12.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <float.h>

View File

@ -41,6 +41,7 @@ NK_API void nk_d3d9_shutdown(void);
#define COBJMACROS
#include <d3d9.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>

View File

@ -38,7 +38,7 @@ NK_API void nk_gdi_set_font(GdiFont *font);
* ===============================================================
*/
#ifdef NK_GDI_IMPLEMENTATION
#include <string.h>
#include <stdlib.h>
#include <malloc.h>

View File

@ -50,7 +50,7 @@ NK_API void nk_gdi_set_font(nk_gdi_ctx gdi, GdiFont* font);
* ===============================================================
*/
#ifdef NK_GDI_IMPLEMENTATION
#include <string.h>
#include <stdlib.h>
#include <malloc.h>

View File

@ -40,6 +40,8 @@ NK_API void nk_gflw3_scroll_callback(GLFWwindow *win, double xof
* ===============================================================
*/
#ifdef NK_GLFW_GL2_IMPLEMENTATION
#include <string.h>
#include <stdlib.h>
#ifndef NK_GLFW_TEXT_MAX
#define NK_GLFW_TEXT_MAX 256

View File

@ -78,6 +78,9 @@ NK_API void nk_glfw3_mouse_button_callback(GLFWwindow *win, int
* ===============================================================
*/
#ifdef NK_GLFW_GL3_IMPLEMENTATION
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#ifndef NK_GLFW_DOUBLE_CLICK_LO
#define NK_GLFW_DOUBLE_CLICK_LO 0.02

View File

@ -50,6 +50,9 @@ NK_API void nk_glfw3_destroy_texture(int tex_index);
*/
#ifdef NK_GLFW_GL4_IMPLEMENTATION
#undef NK_GLFW_GL4_IMPLEMENTATION
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#ifndef NK_GLFW_TEXT_MAX
#define NK_GLFW_TEXT_MAX 256

View File

@ -247,6 +247,7 @@ unsigned char nuklearshaders_nuklear_frag_spv[] = {
};
unsigned int nuklearshaders_nuklear_frag_spv_len = 860;
#include <assert.h>
#include <stddef.h>
#include <string.h>
#define GLFW_INCLUDE_VULKAN
@ -294,6 +295,7 @@ NK_API void nk_glfw3_mouse_button_callback(GLFWwindow *win, int button,
*/
#ifdef NK_GLFW_VULKAN_IMPLEMENTATION
#undef NK_GLFW_VULKAN_IMPLEMENTATION
#include <stdlib.h>
#ifndef NK_GLFW_TEXT_MAX
#define NK_GLFW_TEXT_MAX 256

View File

@ -71,6 +71,8 @@ NK_API void nk_glfw3_mouse_button_callback(GLFWwindow *win, int button,
*/
#ifdef NK_GLFW_VULKAN_IMPLEMENTATION
#undef NK_GLFW_VULKAN_IMPLEMENTATION
#include <assert.h>
#include <stdlib.h>
#ifndef NK_GLFW_TEXT_MAX
#define NK_GLFW_TEXT_MAX 256

View File

@ -49,6 +49,10 @@ void nk_sdlsurface_shutdown(struct sdlsurface_context *sdlsurfa
* ===============================================================
*/
#ifdef NK_SDLSURFACE_IMPLEMENTATION
#include <string.h>
#include <stdlib.h>
#include <assert.h>
struct sdlsurface_context {
struct nk_context ctx;
struct nk_rect scissors;

View File

@ -30,6 +30,8 @@ NK_API void nk_sdl_shutdown(void);
* ===============================================================
*/
#ifdef NK_SDL_GL2_IMPLEMENTATION
#include <string.h>
#include <stdlib.h>
struct nk_sdl_device {
struct nk_buffer cmds;

View File

@ -36,6 +36,8 @@ NK_API void nk_sdl_device_create(void);
*/
#ifdef NK_SDL_GL3_IMPLEMENTATION
#include <stdlib.h>
#include <assert.h>
#include <string.h>
struct nk_sdl_device {

View File

@ -38,7 +38,8 @@ NK_API void nk_sdl_device_create(void);
* ===============================================================
*/
#ifdef NK_SDL_GLES2_IMPLEMENTATION
#include <stdlib.h>
#include <assert.h>
#include <string.h>
struct nk_sdl_device {

View File

@ -39,8 +39,8 @@ NK_API void nk_sdl_shutdown(void);
* ===============================================================
*/
#ifdef NK_SDL_RENDERER_IMPLEMENTATION
#include <strings.h>
#include <string.h>
#include <stdlib.h>
struct nk_sdl_device {
struct nk_buffer cmds;

View File

@ -31,6 +31,8 @@ NK_API void nk_sfml_shutdown(void);
* ===============================================================
*/
#ifdef NK_SFML_GL2_IMPLEMENTATION
#include <cstdlib>
#include <cstring>
struct nk_sfml_device {
struct nk_buffer cmds;

View File

@ -38,7 +38,8 @@ NK_API void nk_sfml_device_destroy(void);
* ===============================================================
*/
#ifdef NK_SFML_GL3_IMPLEMENTATION
#include <cstring>
#include <assert.h>
#include <string>
struct nk_sfml_device {

View File

@ -1,6 +1,10 @@
#ifndef NK_RAW_WAYLAND_H_
#define NK_RAW_WAYLAND_H_
#include <assert.h>
#include <stdio.h>
#include <string.h>
#define WIDTH 800
#define HEIGHT 600

View File

@ -44,6 +44,9 @@ NK_API void nk_xfont_del(Display *dpy, XFont *font);
* ===============================================================
*/
#ifdef NK_XLIB_IMPLEMENTATION
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>

View File

@ -32,6 +32,7 @@ NK_API void nk_x11_device_destroy(void);
* ===============================================================
*/
#ifdef NK_XLIB_GL3_IMPLEMENTATION
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -55,6 +55,10 @@ NK_API void nk_rawfb_resize_fb(struct rawfb_context *rawfb, voi
* ===============================================================
*/
#ifdef NK_RAWFB_IMPLEMENTATION
#include <string.h>
#include <stdlib.h>
#include <assert.h>
struct rawfb_image {
void *pixels;
int w, h, pitch;

View File

@ -49,6 +49,9 @@ NK_API void nk_xlib_shutdown(void);
* ===============================================================
*/
#ifdef NK_XLIBSHM_IMPLEMENTATION
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>

View File

@ -48,6 +48,9 @@ NK_API void nk_xfont_del(Display *dpy, XFont *font);
* ===============================================================
*/
#ifdef NK_XLIB_IMPLEMENTATION
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>