mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-25 23:31:56 +00:00
Moved DLL entry-point for GCC into glew.c rather than a standalone file
included using CMake.
This commit is contained in:
parent
02fc17f511
commit
9548431bd0
@ -53,3 +53,12 @@ GLenum GLEWAPIENTRY glewInit (void)
|
||||
return r;
|
||||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && defined(GLEW_BUILD) && defined(__GNUC__)
|
||||
/* GCC requires a DLL entry point even without any standard library included. */
|
||||
/* Types extracted from windows.h to avoid polluting the rest of the file. */
|
||||
int __stdcall DllMainCRTStartup(void* instance, unsigned reason, void* reserved)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
@ -78,10 +78,6 @@ set (GLEW_SRC_FILES ${GLEW_DIR}/src/glew.c)
|
||||
|
||||
if (WIN32)
|
||||
list (APPEND GLEW_SRC_FILES ${GLEW_DIR}/build/glew.rc)
|
||||
if ((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
|
||||
# GCC can't handle not having a DLL entry point, so give it a fake one
|
||||
list (APPEND GLEW_SRC_FILES ${GLEW_DIR}/src/gcc_dll_entry.c)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
add_library (glew SHARED ${GLEW_SRC_FILES})
|
||||
|
@ -1,7 +0,0 @@
|
||||
#ifdef GLEW_BUILD
|
||||
#include <windows.h>
|
||||
BOOL WINAPI DllMainCRTStartup(HINSTANCE instance, DWORD reason, LPVOID reserved)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user