Skip to content

Commit

Permalink
Moved DLL entry-point for GCC into glew.c rather than a standalone file
Browse files Browse the repository at this point in the history
included using CMake.
  • Loading branch information
dudamoos committed Feb 15, 2016
1 parent 02fc17f commit 9548431
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
9 changes: 9 additions & 0 deletions auto/src/glew_init_tail.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions build/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
7 changes: 0 additions & 7 deletions src/gcc_dll_entry.c

This file was deleted.

0 comments on commit 9548431

Please sign in to comment.