This reverts 72dc626b and replace glibc specific macros with compiler's pre-defined macros. (cherry picked from commit ffc36c27) (cherry picked from commit cab22cae) (cherry picked from commit 1733a1fb)