Fix build on mac.

On mac require a case.
Also, this code is not portable, will fix it in long run.

(cherry-pick of 0f1fda9ee80ba086e4c8960a7d153798e3cf3285.)

Change-Id: I76194b62cea29bd3d21c7ba6c3da4d549bea4738
1 file changed