Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard OPENGL_LIB dependent code #152

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/dispatch_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ epoxy_gl_dlsym(const char *name)
return do_dlsym(&api.gl_handle,
"/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL",
name, true);
#else
#elif defined(OPENGL_LIB)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is correct.

The #if defined(OPENGL_LIB) ... #endif block should only be used around the:

    if (!api.gl_handle)
        get_dlopen_handle(&api.gl_handle, OPENGL_LIB, false);

block. The following block will call dlsym() if the gl_handle is set, and if it isn't, it'll do a dlopen().

The only difference between the Android and Linux paths is that on Linux there's an OPENGL_LIB define in the latter but not in the former.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message is also not really accurate: the Windows conditional path already exists.

void *sym;

if (!api.gl_handle)
Expand All @@ -661,6 +661,8 @@ epoxy_gl_dlsym(const char *name)
api.gl_handle = api.glx_handle; /* skip the dlopen next time */

return sym;
#else
return NULL;
#endif
}

Expand Down