When learning about debugging OpenGL I implemented a function callback which would receive any debug error messages from the OpenGL API whenever something went wrong. In the tutorial it said that the function signature was:
typedef void APIENTRY funcname(GLenum source, GLenum type, GLuint id,
GLenum severity, GLsizei length, const GLchar* message, const void* userParam);
So on Windows I implemented this callback. On Windows APIENTRY is a define for __stdcall. __stdcall I believe is a Windows-specific keyword specifying the calling convention. Later I ported my code to Linux, and for starters my GCC with Eclipse didn't recognise APIENTRY, because it's a Windows define. So I changed it to __stdcall, which I'm not sure if it recognised or not, but regardless it threw an error saying:
"Expected initialiser before glCheckError_"
As my callback function is void __stdcall glCheckError_(/Params/). Removing the __stdcall preface makes the program work fine without it.
I'm wondering whether this prefix is necessary, for either Windows or Linux? The funny thing is that the place that suggested I add __stdcall to the function signature was the Khronos webpage, which holds documentation for OpenGL, so as far as I can tell it shouldn't be specifying OS-specific information, as OpenGL is cross-platform. So do I need this __stdcall prefix?