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