• Chad Versace's avatar
    waffle: Fix waffle_*_get_native functions · b072d9ee
    Chad Versace authored
    This patch fixes all waffle_*_get_native functions for glx, x11_egl, and
    wayland. The functions never did work because I incorrectly implemented
    them like this:
    
        union waffle_native_display*
        glx_display_get_native(...)
        {
            struct waffle_glx_display *n_dpy = malloc(sizeof(*n_dpy));
            [fill n_dpy];
            return (union waffle_native_display*) n_dpy;
        }
    
    That implementation would have been correct if the union were defined as:
    
        union waffle_native_display {
            struct waffle_glx_display glx;
            ...
        };
    
    Instead, the union is defined as:
    
        union waffle_native_display {
            struct waffle_glx_display *glx;
            ...
        };
    
    Therefore, the correct implementation looks like this, modulo error
    checking:
    
        union waffle_native_display*
        glx_display_get_native(...)
        {
            union waffle_native_display *n_dpy = malloc(sizeof(*n_dpy));
            n_dpy->glx = malloc(sizeof(*n_dpy->glx));
            [fill n_dpy->glx];
            return n_dpy;
        }
    Signed-off-by: default avatarChad Versace <chad.versace@linux.intel.com>
    b072d9ee
Name
Last commit
Last update
bin Loading commit data...
cmake/Modules Loading commit data...
doc Loading commit data...
doxygen Loading commit data...
examples Loading commit data...
include Loading commit data...
pkg Loading commit data...
src Loading commit data...
tests Loading commit data...
.gitignore Loading commit data...
CMakeLists.txt Loading commit data...
LICENSE.txt Loading commit data...
README.txt Loading commit data...
waffle.pc.in Loading commit data...