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

Better X11 and Wayland platform detection #111

Merged
merged 3 commits into from
Dec 13, 2016

Conversation

kbrenneman
Copy link
Collaborator

This is a combination of #101 and #102.

The first commit is the same as #101, with some tabs replaced with spaces.

The second commit is the same logic as in #102, by looking for the pointer to _XAllocID.

nwnk and others added 2 commits October 26, 2016 18:07
The problem with using dlsym to look for wl_display_interface is that
variables by that name are emitted into other client libraries besides
libwayland-client. libSDL2 has this property, at least. Instead of that,
use dladdr() to look up the name of the symbol pointed to, and accept
any symbol with the right name as being wayland enough.

Signed-off-by: Adam Jackson <ajax@redhat.com>

v2: Minor formatting change.
In eglGetDisplay, try to identify an X11 display based on a known function
pointer.

This is based on a patch by ajax@redhat.com:
NVIDIA#102
@fafryd1125
Copy link

Build failure on Arch Linux

Tested: libglvnd-git-r468.b78630e + #97 + #111

  CC       libEGL_la-libeglmapping.lo
  CC       libEGL_la-libeglvendor.lo
libegl.c: In function 'eglGetDisplay':
libegl.c:175:42: error: 'XAllocID' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return (XAllocID != NULL && XAllocID == alloc);
                                 ~~~~~~~~~^~~~~~~~
libegl.c:162:11: note: 'XAllocID' was declared here
     void *XAllocID;
           ^~~~~~~~
  CC       libEGL_la-libeglerror.lo
cc1: all warnings being treated as errors
make[4]: *** [Makefile:579: libEGL_la-libegl.lo] Error 1

@fafryd1125
Copy link

c9378ea works great. Thank you.

@nwnk
Copy link
Contributor

nwnk commented Dec 13, 2016

Looks good to me.

@kbrenneman kbrenneman merged commit 480046f into NVIDIA:master Dec 13, 2016
@kbrenneman kbrenneman deleted the libegl-platform-detection branch January 24, 2017 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants