Backport missing parts of 934e49f6ce22102dee104d1f307c1fd694bdbf92.

For some reason acf2fb201c6e52780d7df674b92ee632a2004ae0 does not contain
all the changes in the original commit. These missing changes prevent
Ozone-Wayland from building with clang.