Sfoglia il codice sorgente

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 .
b-aaz 1 anno fa
parent
commit
fb474874db

+ 1 - 0
demo/allegro5/nuklear_allegro5.h

@@ -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

+ 1 - 0
demo/d3d11/nuklear_d3d11.h

@@ -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>

+ 1 - 0
demo/d3d12/nuklear_d3d12.h

@@ -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>

+ 1 - 0
demo/d3d9/nuklear_d3d9.h

@@ -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>
 

+ 1 - 1
demo/gdi/nuklear_gdi.h

@@ -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>
 

+ 1 - 1
demo/gdi_native_nuklear/nuklear_gdi.h

@@ -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>
 

+ 2 - 0
demo/glfw_opengl2/nuklear_glfw_gl2.h

@@ -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

+ 3 - 0
demo/glfw_opengl3/nuklear_glfw_gl3.h

@@ -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

+ 3 - 0
demo/glfw_opengl4/nuklear_glfw_gl4.h

@@ -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

+ 2 - 0
demo/glfw_vulkan/nuklear_glfw_vulkan.h

@@ -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

+ 2 - 0
demo/glfw_vulkan/src/nuklear_glfw_vulkan.in.h

@@ -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

+ 4 - 0
demo/sdl2surface_rawfb/sdl2surface_rawfb.h

@@ -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;

+ 2 - 0
demo/sdl_opengl2/nuklear_sdl_gl2.h

@@ -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;

+ 2 - 0
demo/sdl_opengl3/nuklear_sdl_gl3.h

@@ -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 {

+ 2 - 1
demo/sdl_opengles2/nuklear_sdl_gles2.h

@@ -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 {

+ 2 - 2
demo/sdl_renderer/nuklear_sdl_renderer.h

@@ -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;

+ 2 - 0
demo/sfml_opengl2/nuklear_sfml_gl2.h

@@ -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;

+ 2 - 1
demo/sfml_opengl3/nuklear_sfml_gl3.h

@@ -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 {

+ 4 - 0
demo/wayland_rawfb/nuklear_raw_wayland.h

@@ -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
 

+ 3 - 0
demo/x11/nuklear_xlib.h

@@ -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>

+ 1 - 0
demo/x11_opengl3/nuklear_xlib_gl3.h

@@ -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>

+ 4 - 0
demo/x11_rawfb/nuklear_rawfb.h

@@ -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;

+ 3 - 0
demo/x11_rawfb/nuklear_xlib.h

@@ -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>

+ 3 - 0
demo/x11_xft/nuklear_xlib.h

@@ -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>