diff --git a/common/main/kconfig.h b/common/main/kconfig.h index 71b011216..100cea3b5 100644 --- a/common/main/kconfig.h +++ b/common/main/kconfig.h @@ -155,7 +155,9 @@ extern joyaxis_text_t joyaxis_text; #endif #if DXX_MAX_BUTTONS_PER_JOYSTICK || DXX_MAX_HATS_PER_JOYSTICK -using joybutton_text_t = joystick_text_t::value + joystick_text_length::value>; +#define DXX_JOY_MAX(A,B) ((A) < (B) ? (B) : (A)) +using joybutton_text_t = joystick_text_t::value + DXX_JOY_MAX(sizeof("J H ") + joystick_text_length::value, sizeof("J B") + joystick_text_length::value)>; +#undef DXX_JOY_MAX extern joybutton_text_t joybutton_text; #endif