Skip to content

use _MIN in settings,cpp - #28537

Merged
thinkyhead merged 2 commits into
MarlinFirmware:bugfix-2.1.xfrom
ellensp:fix-MIN
Aug 25, 2026
Merged

use _MIN in settings,cpp#28537
thinkyhead merged 2 commits into
MarlinFirmware:bugfix-2.1.xfrom
ellensp:fix-MIN

Conversation

@ellensp

@ellensp ellensp commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

PR #28436 added

return MIN(MAX_SAVED_MESHES, (meshes_end - meshes_start_index()) / MESH_STORE_SIZE);

To Marlin/src/module/settings.cpp. But MIN is not a standard macro

It errors with

Marlin/src/module/settings.cpp: In static member function 'static uint16_t MarlinSettings::calc_num_meshes()':
Marlin/src/module/settings.cpp:3193:14: error: 'MIN' was not declared in this scope
       return MIN(MAX_SAVED_MESHES, (meshes_end - meshes_start_index()) / MESH_STORE_SIZE);

This PR converts it to use _MIN

Benefits

No longer errors

Configurations

Stock with the following added
AUTO_BED_LEVELING_UBL
EEPROM_SETTINGS

@thinkyhead
thinkyhead merged commit 6e5cf6a into MarlinFirmware:bugfix-2.1.x Aug 25, 2026
67 checks passed
@ellensp
ellensp deleted the fix-MIN branch August 25, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants