Feature constants

Fixes #6569 using @dotuancd  commits.