x11: correctly set the screen number of the current display

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
glx: glx_context_create_native returns GLXContext not bool

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
waffle: remove restrict keyword from public API

We should have never defined the restrict keyword in
the waffle.h header. The word is used as a hint to the
compiler to provide optimisations re: pointer aliasing.

Keep the symbol around, so that the compiler can still
optimise the library.

v2: Move the symbol definition to its user and update the
man pages.

Resolves #11: https://github.com/waffle-gl/waffle/issues/11
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
gbm: cleanup memory leaks

Avoid leaking udev and udev_enumerate. Spotted while
searching for invalid memory access in the wgl platform.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
pkg/archlinux: Add multilib package

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
cmake: add autodetection for waffle_has_egl, glx...

Silence the pkg_check_modules and check set the default
options depending on the packages found.

Error out if the user has selected an option and it's
requirements are not met.

v2:
 - Do not silence pkg_check_modules.
 - Explicitly list the failing requirements.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
wip! cgl: Fix build error introduced by 0e1ae83

commit 0e1ae83abb259f81aaa662defce183e883f2dbd8
Author: Jordan Justen <jordan.l.justen@intel.com>
Date:   Sun May 4 09:40:32 2014 -0700

    core: Stop using attrs->context_full_version

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
wip! cmake: Fix Mac build

commit 62a4aab90bb58b1f9d7fceaeb95abe23ad8d6a4a
Author: Jordan Justen <jordan.l.justen@intel.com>
Date:   Thu Apr 24 10:25:26 2014 -0700

    waffle: Set LINK_INTERFACE_LIBRARIES to empty

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
cgl: use wcore_calloc helper

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
cgl: print the libname on error at cgl_dl_close()

The compiler should have pointed out that there is a
modifier but the parameter is missing. This should
resolve the issue.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
cgl: avoid leaking the PixelFormat

According to apple developer page, starting with OS X v10.5 the
pixelformat is reference counted. The object is created at
CGLChoosePixelFormat and should be unrefeferenced via
CGLReleasePixelFormat/CGLDestroyPixelFormat.

The latter two are identical accoring to the documentation.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>