diff --git a/kitty/data-types.h b/kitty/data-types.h index 6345a2d6e..0eb47bdc2 100644 --- a/kitty/data-types.h +++ b/kitty/data-types.h @@ -7,8 +7,12 @@ #pragma once +#ifdef _POSIX_C_SOURCE +#error "Must include \"data-types.h\" before any system headers" +#endif #define PY_SSIZE_T_CLEAN #include + #include #include #include diff --git a/kitty/launcher/main.c b/kitty/launcher/main.c index 4077a8080..133ce76e8 100644 --- a/kitty/launcher/main.c +++ b/kitty/launcher/main.c @@ -6,6 +6,8 @@ */ #define PY_SSIZE_T_CLEAN +#include + #include #ifdef __APPLE__ #include @@ -18,7 +20,6 @@ #include #include #include -#include #include #include "launcher.h" diff --git a/kitty/launcher/single-instance.c b/kitty/launcher/single-instance.c index 0e06a804c..a12ebbf03 100644 --- a/kitty/launcher/single-instance.c +++ b/kitty/launcher/single-instance.c @@ -5,6 +5,8 @@ * Distributed under terms of the GPL3 license. */ +#include "../data-types.h" + #ifdef __APPLE__ // Needed for _CS_DARWIN_USER_CACHE_DIR #define _DARWIN_C_SOURCE @@ -347,4 +349,3 @@ single_instance_main(int argc, char *argv[], const CLIOptions *opts) { else fail_on_errno("Failed to bind single instance socket"); } else set_single_instance_socket(s); } - diff --git a/kitty/screen.c b/kitty/screen.c index 98645c880..52f91b6be 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -10,6 +10,7 @@ if (PyModule_AddFunctions(module, module_methods) != 0) return false; \ } +#include "data-types.h" #include "control-codes.h" #include "state.h" #include "iqsort.h"