Fixed conversion and deprecated API warnings on Mac OS X.

Replaced Apple-specific code with new one, as suggested in
https://bitbucket.org/alfonse/glloadgen/issue/29/compilation-errors-on-mac-os-x
Hopefully this won't introduce any new issues.