diff --git a/kitty/data-types.c b/kitty/data-types.c index 3af625b5a..f4d795c11 100644 --- a/kitty/data-types.c +++ b/kitty/data-types.c @@ -341,10 +341,14 @@ PyInit_fast_data_types(void) { PyModule_AddIntMacro(m, APC); PyModule_AddIntMacro(m, OSC); PyModule_AddIntMacro(m, FILE_TRANSFER_CODE); - // FreeBSD's man page says this is 1023. Linux says its PATH_MAX. +#ifdef __APPLE__ // Apple says its SHM_NAME_MAX but SHM_NAME_MAX is not actually declared in typical CrApple style. - // Experimentation shows that 1023 is allowed on macOS Catalina + // This value is based on experimentation + PyModule_AddIntConstant(m, "SHM_NAME_MAX", 30); +#else + // FreeBSD's man page says this is 1023. Linux says its PATH_MAX. PyModule_AddIntConstant(m, "SHM_NAME_MAX", MIN(1023, PATH_MAX)); +#endif return m; }