Sanity Check newer Configs too (#21550)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
ellensp 2021-04-08 08:02:09 +12:00 committed by Scott Lahteine
parent dda2f58588
commit 3e1b9e11d7

View File

@ -60,18 +60,23 @@
#undef TEST4 #undef TEST4
/** /**
* We try our best to include sanity checks for all changed configuration * This is to alert you about non-matching versions of config files.
* directives because users have a tendency to use outdated config files with *
* the bleeding-edge source code, but sometimes this is not enough. This check * You can edit the version tag in your old config files and try the build again.
* forces a minimum config file revision. Otherwise Marlin will not build. * The checks below will alert you about options that need to be changed, but they won't
* tell you about new options that you might find useful. So it's recommended to transfer
* your settings to new Configuration files matching your Marlin version as soon as possible.
*/ */
#define HEXIFY(H) _CAT(0x,H) #define HEXIFY(H) _CAT(0x,H)
#if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION) #if !defined(CONFIGURATION_H_VERSION) || HEXIFY(CONFIGURATION_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
#error "You are using an old Configuration.h file, update it before building Marlin." #error "Your Configuration.h file is for an old version of Marlin. Downgrade Marlin or upgrade your Configuration.h."
#elif HEXIFY(CONFIGURATION_H_VERSION) > HEXIFY(REQUIRED_CONFIGURATION_H_VERSION)
#error "Your Configuration.h file is for a newer version of Marlin. Upgrade Marlin or downgrade your Configuration.h."
#endif #endif
#if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION) #if !defined(CONFIGURATION_ADV_H_VERSION) || HEXIFY(CONFIGURATION_ADV_H_VERSION) < HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
#error "You are using an old Configuration_adv.h file, update it before building Marlin." #error "Your Configuration_adv.h file is for an old version of Marlin. Downgrade Marlin or upgrade your Configuration_adv.h."
#elif HEXIFY(CONFIGURATION_ADV_H_VERSION) > HEXIFY(REQUIRED_CONFIGURATION_ADV_H_VERSION)
#error "Your Configuration_adv.h file is for a newer version of Marlin. Upgrade Marlin or downgrade your Configuration_adv.h."
#endif #endif
#undef HEXIFY #undef HEXIFY