Got it. Although the Microchip compiler defines the symbol __GNUC__ it does not define the function __builtin_clzl(x). Therefore
the "#ifdef __GNUC__" statements must be modified to simply define the function: "static uint8_t clz(uint32_t x)".
Then the thing compiles.
Hope this helps someone....