Fix function declarations for Apple
Merge