Fix build on mac.

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

(cherry-pick of 8cb2638779aed52c595761abb2866db79661e1f4.)

Change-Id: I76194b62cea29bd3d21c7ba6c3da4d549bea4738
1 file changed