Fix undefined max in multi-language (#15521)

2.0.x
Tanguy Pruvot 5 years ago committed by Scott Lahteine
parent 7714152013
commit ee20f21a24

@ -65,7 +65,7 @@ typedef const char Language_Str[];
lang == 3 ? GET_LANG(LCD_LANGUAGE_4)::MSG : \ lang == 3 ? GET_LANG(LCD_LANGUAGE_4)::MSG : \
GET_LANG(LCD_LANGUAGE_5)::MSG \ GET_LANG(LCD_LANGUAGE_5)::MSG \
) )
#define MAX_LANG_CHARSIZE max(GET_LANG(LCD_LANGUAGE)::CHARSIZE, \ #define MAX_LANG_CHARSIZE _MAX(GET_LANG(LCD_LANGUAGE)::CHARSIZE, \
GET_LANG(LCD_LANGUAGE_2)::CHARSIZE, \ GET_LANG(LCD_LANGUAGE_2)::CHARSIZE, \
GET_LANG(LCD_LANGUAGE_3)::CHARSIZE, \ GET_LANG(LCD_LANGUAGE_3)::CHARSIZE, \
GET_LANG(LCD_LANGUAGE_4)::CHARSIZE, \ GET_LANG(LCD_LANGUAGE_4)::CHARSIZE, \

@ -44,7 +44,7 @@
#if HAS_SPI_LCD #if HAS_SPI_LCD
#if ENABLED(STATUS_MESSAGE_SCROLLING) #if ENABLED(STATUS_MESSAGE_SCROLLING)
uint8_t MarlinUI::status_scroll_offset; // = 0 uint8_t MarlinUI::status_scroll_offset; // = 0
constexpr uint8_t MAX_MESSAGE_LENGTH = max(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH)); constexpr uint8_t MAX_MESSAGE_LENGTH = _MAX(LONG_FILENAME_LENGTH, MAX_LANG_CHARSIZE * 2 * (LCD_WIDTH));
#else #else
constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH); constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH);
#endif #endif

Loading…
Cancel
Save