From 46bfdc60f6a92640918839772ed4bb0c80ef7930 Mon Sep 17 00:00:00 2001 From: ikits Date: Mon, 3 Feb 2003 17:52:35 +0000 Subject: [PATCH] added MINGW support git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@34 783a27ee-832a-0410-bc00-9f386506c6dd --- include/GL/glew.h | 49 ++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/include/GL/glew.h b/include/GL/glew.h index 8c8a7ce..e3e9d24 100644 --- a/include/GL/glew.h +++ b/include/GL/glew.h @@ -97,36 +97,43 @@ /* * GLEW does not include to avoid name space pollution. - * GL needs APIENTRY and WINGDIAPI, GLU needs CALLBACK and wchar_t + * GL needs APIENTRY, GLU needs CALLBACK, wchar_t, and GL_API * defined properly. */ /* */ #ifndef APIENTRY #define GLEW_APIENTRY_DEFINED -#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) -#define APIENTRY __stdcall -#else -#define APIENTRY -#endif +# if defined(__CYGWIN__) || defined(__MINGW32__) +# define APIENTRY __attribute__ ((__stdcall__)) +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif #endif /* */ #ifndef CALLBACK -#if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) -#define CALLBACK __stdcall -#else -#define CALLBACK -#endif +#define GLEW_CALLBACK_DEFINED +# if defined(__CYGWIN__) || defined(__MINGW32__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif #endif /* and */ -#ifndef WINGDIAPI -#define GLEW_WINGDIAPI_DEFINED -#define WINGDIAPI __declspec(dllimport) -#endif +//#ifndef WINGDIAPI +//#define GLEW_WINGDIAPI_DEFINED +//#define WINGDIAPI __declspec(dllimport) +//#endif /* */ #ifndef _WCHAR_T_DEFINED typedef unsigned short wchar_t; #define _WCHAR_T_DEFINED #endif +/* */ +#define GLAPI extern /* * GLEW_STATIC needs to be set when including the @@ -145,6 +152,7 @@ typedef unsigned short wchar_t; #else /* _UNIX */ +#define GLEW_APIENTRY_DEFINED #define APIENTRY #define GLAPI extern #define GLAPIENTRY @@ -4590,11 +4598,16 @@ extern GLEW_EXPORT const char* glewGetErrorString (GLint error); #undef APIENTRY #endif -#ifdef GLEW_WINGDIAPI_DEFINED -#undef GLEW_WINGDIAPI_DEFINED -#undef WINGDIAPI +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK #endif +//#ifdef GLEW_WINGDIAPI_DEFINED +//#undef GLEW_WINGDIAPI_DEFINED +//#undef WINGDIAPI +//#endif + #undef GLEW_EXPORT #endif /* __glew_h__ */