diff --git a/glfw/source-info.json b/glfw/source-info.json index 9bb069df8..ee48cae69 100644 --- a/glfw/source-info.json +++ b/glfw/source-info.json @@ -113,8 +113,7 @@ "posix_thread.h", "glx_context.h", "egl_context.h", - "osmesa_context.h", - "linux_joystick.h" + "osmesa_context.h" ], "sources": [ "x11_init.c", @@ -125,8 +124,7 @@ "posix_thread.c", "glx_context.c", "egl_context.c", - "osmesa_context.c", - "linux_joystick.c" + "osmesa_context.c" ] } -} \ No newline at end of file +} diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index ef895ecd8..a7f78f560 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -5,8 +5,8 @@ * Distributed under terms of the GPL3 license. */ -#include "threading.h" #include "state.h" +#include "threading.h" #include "screen.h" #include "fonts.h" #include diff --git a/kitty/data-types.h b/kitty/data-types.h index 236bcef24..47a915bcf 100644 --- a/kitty/data-types.h +++ b/kitty/data-types.h @@ -7,13 +7,12 @@ #pragma once - +#define PY_SSIZE_T_CLEAN +#include #include #include #include #include -#define PY_SSIZE_T_CLEAN -#include // Required minimum OpenGL version #define OPENGL_REQUIRED_VERSION_MAJOR 3 #define OPENGL_REQUIRED_VERSION_MINOR 3 diff --git a/kitty/glfw-wrapper.c b/kitty/glfw-wrapper.c index 1b142ca5c..677f49948 100644 --- a/kitty/glfw-wrapper.c +++ b/kitty/glfw-wrapper.c @@ -1,7 +1,7 @@ -#include #include "data-types.h" #include "glfw-wrapper.h" +#include static void* handle = NULL; diff --git a/kitty/keys.c b/kitty/keys.c index 2930d1364..2eb5e8f75 100644 --- a/kitty/keys.c +++ b/kitty/keys.c @@ -5,8 +5,8 @@ * Distributed under terms of the GPL3 license. */ -#include "keys.h" #include "state.h" +#include "keys.h" #include "screen.h" #include "glfw-wrapper.h" #include "control-codes.h" diff --git a/kitty/shaders.c b/kitty/shaders.c index 4c3844c91..874c70717 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -5,8 +5,8 @@ * Distributed under terms of the GPL3 license. */ -#include "gl.h" #include "fonts.h" +#include "gl.h" enum { CELL_PROGRAM, CELL_BG_PROGRAM, CELL_SPECIAL_PROGRAM, CELL_FG_PROGRAM, CURSOR_PROGRAM, BORDERS_PROGRAM, GRAPHICS_PROGRAM, GRAPHICS_PREMULT_PROGRAM, BLIT_PROGRAM, NUM_PROGRAMS }; enum { SPRITE_MAP_UNIT, GRAPHICS_UNIT, BLIT_UNIT }; diff --git a/kitty/threading.h b/kitty/threading.h index 6aa518c37..085fe9c27 100644 --- a/kitty/threading.h +++ b/kitty/threading.h @@ -8,10 +8,13 @@ #include #include -#ifdef __APPLE__ +#if defined(__APPLE__) // I cant figure out how to get pthread.h to include this definition on macOS. MACOSX_DEPLOYMENT_TARGET does not work. extern int pthread_setname_np(const char *name); -#else +#elif defined(__FreeBSD__) +// Function has a different name on FreeBSD +void pthread_set_name_np(pthread_t tid, const char *name); +#else // Need _GNU_SOURCE for pthread_setname_np on linux and that causes other issues on systems with old glibc extern int pthread_setname_np(pthread_t, const char *name); #endif @@ -19,8 +22,10 @@ extern int pthread_setname_np(pthread_t, const char *name); static inline void set_thread_name(const char *name) { int ret = 0; -#ifdef __APPLE__ - ret = pthread_setname_np(name); +#if defined(__APPLE__) + ret = pthreadset_name_np(name); +#elif defined(__FreeBSD__) + pthread_set_name_np(pthread_self(), name); #else ret = pthread_setname_np(pthread_self(), name); #endif