fixed compile error in macos