newer gccs default to -std=c++17 which no longer allows operator++ to be used on 'bool's. this patch changes the type to unsigned char, just like newer gcc versions have it.