Skip to content

Commit

Permalink
Fix undefined max in multi-language (MarlinFirmware#15521)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot authored and thinkyhead committed Oct 13, 2019
1 parent 7714152 commit ee20f21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/core/multi_language.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef const char Language_Str[];
lang == 3 ? GET_LANG(LCD_LANGUAGE_4)::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_3)::CHARSIZE, \
GET_LANG(LCD_LANGUAGE_4)::CHARSIZE, \
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#if HAS_SPI_LCD
#if ENABLED(STATUS_MESSAGE_SCROLLING)
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
constexpr uint8_t MAX_MESSAGE_LENGTH = MAX_LANG_CHARSIZE * (LCD_WIDTH);
#endif
Expand Down

0 comments on commit ee20f21

Please sign in to comment.