[waffle] [GSOC 2014] WGL support in Waffle

2014-03-21 Thread Emil Velikov
Hi all, Following all the questions of other students on the subject I decided to take a look on the topic and it kind of grew on me, to the point that I've decided to prep a quick last minute application (see below). As you may already know my name is Emil Velikov, I'm in my final

Re: [waffle] [PATCH 2/6] wflinfo: Cleanup signature of wflinfo_try_create_context()

2014-05-02 Thread Emil Velikov
On 29/04/14 04:43, Chad Versace wrote: > The function creates and returns two objects: a context and a config. > The context is the function's return value, and the config is an out > parameter. > > Functions with asymmetric returns, I find awkard. Fix the signature to > return both objects as out

Re: [waffle] [PATCH 2/6] wflinfo: Cleanup signature of wflinfo_try_create_context()

2014-05-05 Thread Emil Velikov
On 05/05/14 17:31, Chad Versace wrote: > On Sat, May 03, 2014 at 12:36:49AM +0100, Emil Velikov wrote: >> On 29/04/14 04:43, Chad Versace wrote: >>> The function creates and returns two objects: a context and a config. >>> The context is the function's return

Re: [waffle] [PATCH] pkg arch/mac: Update release tarball urls

2014-05-09 Thread Emil Velikov
On 09/05/14 18:58, Jordan Justen wrote: > Signed-off-by: Jordan Justen > --- > > Note: I did not test these changes. > The arch change looks and work like a charm. Feel free to slap Reviewed-by/Tested-by: Emil Velikov Just added your tree to git remotes and noticed an int

[waffle] Windows library is almost up

2014-05-22 Thread Emil Velikov
Hi guys, A bit of update + a couple of questions: 1. Modified cmake build. Now we have a windows libraries (cross-compiled with mingw-w64). - Why do we use absolute paths for the install targets ? I believe that (cmake guys confirmed) one should normally use relative ones. - To the best of m

Re: [waffle] Windows library is almost up

2014-05-24 Thread Emil Velikov
On 23/05/14 17:05, Jose Fonseca wrote: > > I wouldn't use DONT_RESOLVE_DLL_REFERENCES -- it seems something somebody > would use for example, to read debugging/resource information, but not > actually running any code from a DLL. > Initially I was under the impression that it was closer to RT

[waffle] [GSOC 2014] How to deal with non win32 api, wgl(Create, Make)Context depends on existing window

2014-05-24 Thread Emil Velikov
Hi all, Another round of interesting bits and bulbs. The email came out a bit longer than expected, although it provides a decent list of possible solutions. Let me know which one you'll go with. Four topics sorted by priority - high to low (based on my humble opinion) * ChoosePixelFormat - clo

[waffle] [PATCH 6/8] waffle: move WAFFLE_API out of the API header

2014-05-24 Thread Emil Velikov
Signed-off-by: Emil Velikov --- include/waffle/waffle.h | 74 +++-- src/waffle/api/api_priv.h | 14 +++ src/waffle/api/waffle_attrib_list.c | 10 +++-- src/waffle/api/waffle_config.c | 6 +-- src/waffle/api/waffle_context.c | 6

[waffle] [PATCH 0/8] Move WAFFLE_API out of the public header + misc patches

2014-05-24 Thread Emil Velikov
Hi all, Here is a small selection of patches - mostly bugfixes, while going though waffle's existing implementations and working on wgl. The series is available in the for-upstream branch at my github repo https://github.com/evelikov/waffle Comments, tips and suggestions are greatly appreciated.

[waffle] [PATCH 8/8] core: update wcore_enum_to_string()

2014-05-24 Thread Emil Velikov
Add a couple of missing cases - PLATFORM_GBM and DL_OPENGL_ES3. Signed-off-by: Emil Velikov --- src/waffle/core/wcore_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/waffle/core/wcore_util.c b/src/waffle/core/wcore_util.c index 1cd5825..2276dde 100644 --- a/src/waffle/core

[waffle] [PATCH 1/8] cgl: remove unused forward declaration of linux_platform

2014-05-24 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/waffle/cgl/cgl_platform.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/waffle/cgl/cgl_platform.h b/src/waffle/cgl/cgl_platform.h index 71bf5b8..06cd834 100644 --- a/src/waffle/cgl/cgl_platform.h +++ b/src/waffle/cgl/cgl_platform.h @@ -28,8 +28,6

[waffle] [PATCH 2/8] pkg/archlinux: Update to a dual (+multilib) package

2014-05-24 Thread Emil Velikov
Include both 64bit and multilib binaries when building on x86-64 platform. This saves us deeping track of version numbers and interdependencies in case of a split package. Signed-off-by: Emil Velikov --- pkg/archlinux/waffle-1.3.0/PKGBUILD | 84 +++-- 1 file

[waffle] [PATCH 4/8] cmake: use the relative path in the install targets

2014-05-24 Thread Emil Velikov
Otherwise make DESTDIR=... install will not function properly. Signed-off-by: Emil Velikov --- CMakeLists.txt| 4 ++-- doc/CMakeLists.txt| 4 ++-- examples/CMakeLists.txt | 2 +- include/CMakeLists.txt| 2 +- man/html.cmake| 2 +- man/manpages.cmake

[waffle] [PATCH 5/8] cmake: reformat/update install targets

2014-05-24 Thread Emil Velikov
Cleanup the formatting and add component for each build target. The latter will allow us to use CPack to create a component based installer for Windows. Additionally install wflinfo to CMAKE_INSTALL_BINDIR rather than hardcoding it to 'bin'. Signed-off-by: Emil Velikov --- CMak

[waffle] [PATCH 7/8] waffle: define WAFFLE_API for Windows platforms

2014-05-24 Thread Emil Velikov
Allows us to properly annotate the functions and export only the required ones. Signed-off-by: Emil Velikov --- src/waffle/api/api_priv.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/waffle/api/api_priv.h b/src/waffle/api/api_priv.h index 0bbeada..1fec575 100644

Re: [waffle] [PATCH 2/8] pkg/archlinux: Update to a dual (+multilib) package

2014-05-24 Thread Emil Velikov
On 24/05/14 23:51, Emil Velikov wrote: > Include both 64bit and multilib binaries when building > on x86-64 platform. This saves us deeping track of version > numbers and interdependencies in case of a split package. > > Signed-off-by: Emil Velikov > --- > pkg/archlinux/

Re: [waffle] [GSOC 2014] How to deal with non win32 api, wgl(Create, Make)Context depends on existing window

2014-05-25 Thread Emil Velikov
On 25/05/14 21:35, Jordan Justen wrote: > On Sat, May 24, 2014 at 12:28 PM, Emil Velikov > wrote: >> * Library dependencies, etc. (low priority) >> libwaffle-1.dll depends on mingw-w64 dlls - should we nuke the dependency, >> ship them in the zip or leave it to the us

Re: [waffle] [GSOC 2014] How to deal with non win32 api, wgl(Create, Make)Context depends on existing window

2014-05-28 Thread Emil Velikov
On 24/05/14 20:28, Emil Velikov wrote: > Hi all, > > Another round of interesting bits and bulbs. > Bit of an update: > The email came out a bit longer than expected, although it provides a decent > list of possible solutions. Let me know which one you'll go with. >

Re: [waffle] [GSOC 2014] How to deal with non win32 api, wgl(Create, Make)Context depends on existing window

2014-05-28 Thread Emil Velikov
On 28/05/14 20:37, Emil Velikov wrote: > >window_handle = CreateWindow(...) >device_context = GetDC(window_handle); > >gl_rendering_context = wglCreateContext(device_context); >wglMakeCurrent (device_handle, gl_rendering_context); > >

Re: [waffle] [PATCH 5/8] cmake: reformat/update install targets

2014-05-30 Thread Emil Velikov
On 31/05/14 01:43, Chad Versace wrote: > On Sat, May 24, 2014 at 11:51:32PM +0100, Emil Velikov wrote: >> Cleanup the formatting and add component for each build target. >> The latter will allow us to use CPack to create a component >> based installer for Windows. > > I

[waffle] [PATCH 08/10] cgl: avoid leaking the PixelFormat

2014-05-30 Thread Emil Velikov
: Emil Velikov --- src/waffle/cgl/cgl_config.m | 4 1 file changed, 4 insertions(+) diff --git a/src/waffle/cgl/cgl_config.m b/src/waffle/cgl/cgl_config.m index 7a74438..5252e12 100644 --- a/src/waffle/cgl/cgl_config.m +++ b/src/waffle/cgl/cgl_config.m @@ -50,6 +50,9 @@ cgl_config_destroy

[waffle] [PATCH 04/10] cmake: add autodetection for waffle_has_egl, glx...

2014-05-30 Thread Emil Velikov
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. Signed-off-by: Emil Velikov --- CMakeLists.txt | 2 +- Options.

[waffle] [PATCH 05/10] waffle: remove found_platform from waffle_init_parse_attrib_list

2014-05-30 Thread Emil Velikov
Whenever a platform is missing a case statement, the default will kick in throwing an error and exiting the function. Signed-off-by: Emil Velikov --- src/waffle/api/waffle_init.c | 9 - 1 file changed, 9 deletions(-) diff --git a/src/waffle/api/waffle_init.c b/src/waffle/api

[waffle] [PATCH 03/10] waffle: remove restrict keyword from public API

2014-05-30 Thread Emil Velikov
the man pages. Resolves #11: https://github.com/waffle-gl/waffle/issues/11 Signed-off-by: Emil Velikov --- include/waffle/waffle.h | 8 ++-- man/waffle_is_extension_in_string.3.xml | 4 ++-- src/waffle/api/waffle_gl_misc.c | 4 3 files changed, 8 insertions(+), 8

[waffle] [PATCH 02/10] cmake: reformat/update install targets

2014-05-30 Thread Emil Velikov
COMPONENT. Suggested by Chad. Signed-off-by: Emil Velikov --- CMakeLists.txt| 14 ++ doc/CMakeLists.txt| 19 +-- examples/CMakeLists.txt | 12 include/CMakeLists.txt| 18 +++--- man/html.cmake| 7 ++

[waffle] [PATCH 01/10] pkg/archlinux: Update to a dual (+multilib) package

2014-05-30 Thread Emil Velikov
Include both 64bit and multilib binaries when building on x86-64 platform. This saves us deeping track of version numbers and interdependencies in case of a split package. v2: Rebase and bump pkgrel Signed-off-by: Emil Velikov --- pkg/archlinux/waffle-1.3.0/PKGBUILD | 86

[waffle] [PATCH 00/10] Autodetection of waffle_has_egl, glx... memory leaks and more

2014-05-30 Thread Emil Velikov
Hi all, It seems like Chad's pull of the previous series came just in time, as I was cooking this one :) First two patches are resent from last time, with minor fixes. The third one nukes 'restrict' from our public header, while it preserves it in the definition of the function, so that the comp

[waffle] [PATCH 09/10] x11: correctly set the screen number of the current display

2014-05-30 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/waffle/x11/x11_display.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/waffle/x11/x11_display.c b/src/waffle/x11/x11_display.c index 43b6ef0..8a3524d 100644 --- a/src/waffle/x11/x11_display.c +++ b/src/waffle/x11/x11_display.c

[waffle] [PATCH 10/10] glx: glx_context_create_native returns GLXContext not bool

2014-05-30 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/waffle/glx/glx_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/waffle/glx/glx_context.c b/src/waffle/glx/glx_context.c index c7a7d91..62573dc 100644 --- a/src/waffle/glx/glx_context.c +++ b/src/waffle/glx/glx_context.c

[waffle] [PATCH 06/10] cgl: use wcore_calloc helper

2014-05-30 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/waffle/cgl/cgl_config.m | 6 ++ src/waffle/cgl/cgl_context.m | 6 ++ src/waffle/cgl/cgl_display.m | 6 ++ src/waffle/cgl/cgl_platform.m | 6 ++ src/waffle/cgl/cgl_window.m | 6 ++ 5 files changed, 10 insertions(+), 20 deletions

Re: [waffle] [GSOC 2014] How to deal with non win32 api, wgl(Create, Make)Context depends on existing window

2014-05-31 Thread Emil Velikov
On 31/05/14 19:59, Jose Fonseca wrote: > - Original Message - >> On 24/05/14 20:28, Emil Velikov wrote: [snip] >> >> AFAICS waffle is unique wrt other projects (apitrace, epoxy, glut) as it >> allows the PixelFormat to be called prior to the creation of

[waffle] [PATCH 2/3] wflinfo: don't leak the current context

2014-06-01 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/utils/wflinfo.c | 4 1 file changed, 4 insertions(+) diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c index eba4e8f..9486361 100644 --- a/src/utils/wflinfo.c +++ b/src/utils/wflinfo.c @@ -1062,6 +1062,10 @@ main(int argc, char **argv) if (!ok

[waffle] [PATCH 0/3] Memory leak fixes

2014-06-01 Thread Emil Velikov
Spotted while searching for a severe memory corruption under wgl. Did not manage to find it yet, although notices these bad boys. I will case the corruption bug over the next few days + cleanup&split the patches hopefully I will see what's going wrong, or perhaps someone will be kind enough to poi

[waffle] [PATCH 1/3] gbm: cleanup memory leaks

2014-06-01 Thread Emil Velikov
Avoid leaking udev and udev_enumerate. Spotted while searching for invalid memory access in the wgl platform. Signed-off-by: Emil Velikov --- src/waffle/gbm/wgbm_display.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/waffle/gbm/wgbm_display.c b/src/waffle/gbm

[waffle] [PATCH 3/3] examples/gl_basic: don't leak the current context

2014-06-01 Thread Emil Velikov
Signed-off-by: Emil Velikov --- examples/gl_basic.c | 4 1 file changed, 4 insertions(+) diff --git a/examples/gl_basic.c b/examples/gl_basic.c index 22b6abf..8e1a28c 100644 --- a/examples/gl_basic.c +++ b/examples/gl_basic.c @@ -613,6 +613,10 @@ main(int argc, char **argv) if (!ok

Re: [waffle] [GSOC 2014] How to deal with non win32 api, wgl(Create, Make)Context depends on existing window

2014-06-03 Thread Emil Velikov
On 02/06/14 19:55, Chad Versace wrote: > On Sat, May 31, 2014 at 12:02:10PM -0700, Jose Fonseca wrote: >> >> >> - Original Message - >>> >>> >>> - Original Message - >>>> On 24/05/14 20:28, Emil Velikov wrote: >>&

Re: [waffle] [GSOC 2014] How to deal with non win32 api, wgl(Create, Make)Context depends on existing window

2014-06-04 Thread Emil Velikov
On 04/06/14 21:18, Jose Fonseca wrote: > > > - Original Message - >> On Sun, May 25, 2014 at 08:00:49PM -0700, Jordan Justen wrote: >>> On Sun, May 25, 2014 at 2:43 PM, Emil Velikov >>> wrote: >>>> On 25/05/14 21:35, Jordan Justen wrote:

[waffle] [GSOC2014] Current design/implementation + the infamous corruption

2014-06-04 Thread Emil Velikov
Hi all, Over the last few days I have been though some head-scratching and re-writing things, in order to resolve an "interesting" memory corruption to no avail :'( Before explaining more about the issue here is some info about the current design + where to get the patches. Let me know if you wou

Re: [waffle] [GSOC2014] Current design/implementation + the infamous corruption

2014-06-05 Thread Emil Velikov
On 05/06/14 03:19, Emil Velikov wrote: > Hi all, > > Over the last few days I have been though some head-scratching and re-writing > things, in order to resolve an "interesting" memory corruption to no avail :'( > > Before explaining more about the issue he

Re: [waffle] [PATCH 05/10] waffle: remove found_platform from waffle_init_parse_attrib_list

2014-06-06 Thread Emil Velikov
On 06/06/14 07:25, Chad Versace wrote: > On Sat, May 31, 2014 at 03:22:03AM +0100, Emil Velikov wrote: >> Whenever a platform is missing a case statement, the default will >> kick in throwing an error and exiting the function. > > Ah, but that's not what '

Re: [waffle] [PATCH 04/10] cmake: add autodetection for waffle_has_egl, glx...

2014-06-06 Thread Emil Velikov
On 06/06/14 07:18, Chad Versace wrote: > On Sat, May 31, 2014 at 03:22:02AM +0100, Emil Velikov wrote: >> Silence the pkg_check_modules and check set the default >> options depending on the packages found. > > This is a good idea and will make Waffle easier to configure for &

Re: [waffle] [PATCH 01/10] pkg/archlinux: Update to a dual (+multilib) package

2014-06-06 Thread Emil Velikov
On 06/06/14 06:55, Chad Versace wrote: > On Sat, May 31, 2014 at 03:21:59AM +0100, Emil Velikov wrote: >> Include both 64bit and multilib binaries when building >> on x86-64 platform. This saves us deeping track of version >> numbers and interdependencies in case of a sp

[waffle] [PATCHv2 04/10] cmake: add autodetection for waffle_has_egl, glx...

2014-06-06 Thread Emil Velikov
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 Ve

[waffle] [PATCH 01/10] pkg/archlinux: Add multilib package

2014-06-06 Thread Emil Velikov
Signed-off-by: Emil Velikov --- New patch that adds a separate multilib PKGBUILD. In theory one can merge the two, although its not at all adviseable. Runtime dependency of waffle={pkgver} is added to keep help us keep things in sync. -Emil pkg/archlinux/lib32-waffle-1.3.0/PKGBUILD | 63

Re: [waffle] [GSOC2014] Current design/implementation + the infamous corruption

2014-06-06 Thread Emil Velikov
On 06/06/14 09:09, Juha-Pekka Heikkilä wrote: > On Fri, June 6, 2014 9:45 am, Chad Versace wrote: >> On Thu, Jun 05, 2014 at 05:49:04PM +0100, Emil Velikov wrote: >>> On 05/06/14 03:19, Emil Velikov wrote: >> >>>> waffle_window_create(config, w, h) >>>&

Re: [waffle] [GSOC2014] Current design/implementation + the infamous corruption

2014-06-06 Thread Emil Velikov
On 06/06/14 14:00, Jose Fonseca wrote: > > > - Original Message - >> On 05/06/14 03:19, Emil Velikov wrote: >>> Hi all, >>> >>> Over the last few days I have been though some head-scratching and >>> re-writing >>> things, in ord

Re: [waffle] [PATCH 05/10] waffle: remove found_platform from waffle_init_parse_attrib_list

2014-06-11 Thread Emil Velikov
On 11/06/14 05:46, Chad Versace wrote: > On Fri, Jun 06, 2014 at 12:24:06PM +0100, Emil Velikov wrote: >> On 06/06/14 07:25, Chad Versace wrote: >>> On Sat, May 31, 2014 at 03:22:03AM +0100, Emil Velikov wrote: >>>> Whenever a platform is missing a case statement,

[waffle] Waffle and GL dispatch

2014-06-24 Thread Emil Velikov
Hi all, Recently I've noticed that a while back Eric took a stab at getting piglit's gl dispatch (insanity) inside waffle. Unfortunately the mailing list is rather silent on the topic. Does anyone know anything on the subject ? Cheers, Emil ___ waffle

[waffle] waffle-wgl a hefty mId-term code drop :)

2014-06-26 Thread Emil Velikov
Hi all, It's official the first half of the project is now complete. Concise and up-to the point information can be seen in the release notes [1]. For anyone interested in hearing more on the topic I am writing a small document that explains the approach used and why I did thing this way. The do

Re: [waffle] Waffle and GL dispatch

2014-06-26 Thread Emil Velikov
On 24/06/14 20:31, Eric Anholt wrote: > Emil Velikov writes: > >> Hi all, >> >> Recently I've noticed that a while back Eric took a stab at getting piglit's >> gl dispatch (insanity) inside waffle. >> >> Unfortunately the mailing list

Re: [waffle] [PATCH 0/3] Memory leak fixes

2014-06-26 Thread Emil Velikov
On 06/06/14 07:38, Chad Versace wrote: > On Sun, Jun 01, 2014 at 03:11:59PM +0100, Emil Velikov wrote: >> Spotted while searching for a severe memory corruption under wgl. >> Did not manage to find it yet, although notices these bad boys. > > Awesome. Patch 1 is rb'

[waffle] waffle vs msvc: Round 1, Fight !!!

2014-06-29 Thread Emil Velikov
Hello all, Another day another long email :) As usual, a list of issues, possible solutions, and my personal preference for each. At the end I have tried to assign a priority for most. Any input would be greatly appreciated. Highlights: General (nitbits): * C "Hello world" does not work OOTB

Re: [waffle] [PATCH] core: Remove empty structs from core objects

2014-07-02 Thread Emil Velikov
h a pair of safe typecast functions that provide > bidirectional casting waffle_OBJ <-> wcore_OBJ. > While we cannot use container_of() prior to casting I believe that we should be safe for the time being. Thank you. It works like a charm. Reviewed-by: Emil Velikov > Reported

Re: [waffle] waffle vs msvc: Round 1, Fight !!!

2014-07-02 Thread Emil Velikov
On 2 July 2014 00:22, Chad Versace wrote: > On Mon, Jun 30, 2014 at 01:05:27AM +0100, Emil Velikov wrote: >> Hello all, >> >> Another day another long email :) >> >> As usual, a list of issues, possible solutions, and my personal >> preference for ea

[waffle] [PATCH 05/33] api: remove double NULL check

2014-07-07 Thread Emil Velikov
We check if the object is NULL before appending it to the obj_list and a second time as we append it. Drop the latter as it makes the code more confusing than it needs to be. Signed-off-by: Emil Velikov --- src/waffle/api/waffle_context.c | 2 +- src/waffle/api/waffle_gl_misc.c | 4 ++-- 2

[waffle] [PATCH 07/33] linux: plug a memory leak

2014-07-07 Thread Emil Velikov
l platfrom->destroy() and effectively cleanup this and other memory hunks. Chad, do you have a plan/idea how to handle this ? I'm assuming that your plan is to tackle this once waffle_init is gone/replaced with a better solution (issue #7). Cc: Chad Versace Signed-off-by: Emil Velikov ---

[waffle] [PATCH 08/33] core: return false on failure in waffle_window_resize

2014-07-07 Thread Emil Velikov
The function return type is bool not *. Signed-off-by: Emil Velikov --- src/waffle/api/waffle_window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/waffle/api/waffle_window.c b/src/waffle/api/waffle_window.c index 207ef33..81f95f8 100644 --- a/src/waffle/api

[waffle] [PATCH 17/33] core: Convert to c11 threads

2014-07-07 Thread Emil Velikov
Will allow us more freedom wrt building/using waffle on multiple OS's (mostly non-posix). Note that pthreads_once has been converted to call_once which "can never fail". Signed-off-by: Emil Velikov --- src/waffle/CMakeLists.txt | 1 + src/waffle/core/wcore_display.c |

[waffle] [PATCH 13/33] c99: define inline keyword and use it across waffle core

2014-07-07 Thread Emil Velikov
This brings us a step closer to getting waffle to build under msvc 2013. Signed-off-by: Emil Velikov --- include/c99_compat.h | 15 +++ src/waffle/core/wcore_display.h | 2 ++ src/waffle/core/wcore_error.c| 1 + src/waffle/core/wcore_platform.h | 1 + 4 files

[waffle] [PATCH 19/33] third_party/threads: correct assertion

2014-07-07 Thread Emil Velikov
We should assert when either the function or the flag (ptr) is null as otherwise we would deref the null pointers. Signed-off-by: Emil Velikov --- third_party/threads/threads_win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/threads/threads_win32.c b

[waffle] [PATCH 16/33] third_party/threads: import c11 threads emulation wrappers

2014-07-07 Thread Emil Velikov
://gist.github.com/yohhoy/2223710/#comment-710118 - don't implement thrd_current on Windows - don't include assert.h if the assert macro is already defined Signed-off-by: Emil Velikov --- CMakeLists.txt | 6 + third_party/threads/CMakeLists.txt | 18 ++ third_party/threa

[waffle] [PATCH 06/33] wflinfo: use waffle_dl_sym to get core functions

2014-07-07 Thread Emil Velikov
Unlike MacOS and Linux, Windows is less fortunate to people who prefer to fetch core OpenGL symbols via wglGetProcAddress. Until we merge piglit's dispatch in one shape or the other, we'll need to manually pick/set the correct function that is used for each function. Signed-off-by: Em

[waffle] [PATCH 12/33] c99: move restrict keyword to c99_compat.h header

2014-07-07 Thread Emil Velikov
Will be used for all the mayhem needed to get waffle building on a non c99 compliant compilers. Signed-off-by: Emil Velikov --- include/c99_compat.h| 40 src/waffle/api/waffle_gl_misc.c | 5 + 2 files changed, 41 insertions(+), 4

[waffle] [PATCH 11/33] waffle_test: build as a static library

2014-07-07 Thread Emil Velikov
Will allow us to move the -fvisiblity=hidden to a global scale, without breaking the tests. Makes little sense to have a shared library only for testing perposes anyway. Signed-off-by: Emil Velikov --- src/waffle_test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[waffle] [PATCH 14/33] c99: add snprintf and strcasecmp

2014-07-07 Thread Emil Velikov
Another two C99 functions missing from msvc 2013... Signed-off-by: Emil Velikov --- include/c99_compat.h | 44 1 file changed, 44 insertions(+) diff --git a/include/c99_compat.h b/include/c99_compat.h index dc0977f..bc8ddc6 100644 --- a/include

[waffle] [PATCH 24/33] core: use compiler specific (noreturn)

2014-07-07 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/waffle/core/wcore_tinfo.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/waffle/core/wcore_tinfo.c b/src/waffle/core/wcore_tinfo.c index 7d749b7..9a190f9 100644 --- a/src/waffle/core/wcore_tinfo.c +++ b/src/waffle/core

[waffle] [PATCH 22/33] core: wcore_error_unittest include c99_compat.h

2014-07-07 Thread Emil Velikov
... in order for us to use the snprintf when building with msvc. Signed-off-by: Emil Velikov --- src/waffle/core/wcore_error_unittest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/waffle/core/wcore_error_unittest.c b/src/waffle/core/wcore_error_unittest.c index

[waffle] [PATCH 10/33] cmake: build with fPIC when possible

2014-07-07 Thread Emil Velikov
Some of our third_party libraries may be build without it thus we'll fail at link tim. Signed-off-by: Emil Velikov --- cmake/Modules/WaffleDefineCompilerFlags.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/Modules/WaffleDefineCompilerFlags.cmake b/cmake/Mo

[waffle] [PATCH 03/33] cgl: avoid leaking the PixelFormat

2014-07-07 Thread Emil Velikov
: Emil Velikov --- src/waffle/cgl/cgl_config.m | 4 1 file changed, 4 insertions(+) diff --git a/src/waffle/cgl/cgl_config.m b/src/waffle/cgl/cgl_config.m index 7a74438..5252e12 100644 --- a/src/waffle/cgl/cgl_config.m +++ b/src/waffle/cgl/cgl_config.m @@ -50,6 +50,9 @@ cgl_config_destroy

[waffle] Some new and old fixes

2014-07-07 Thread Emil Velikov
Hi all, After respinning the latest changes (and ripping out WGL as it requires some api/abi changes) here is a lovely list of fixes that gets us closer to building waffle with mingw/msvc. The first four patches are old (three cgl fixes that Chad would like to test prior to pushing them + a patch

[waffle] [PATCH 04/33] core: Remove empty structs from core objects

2014-07-07 Thread Emil Velikov
at provide bidirectional casting waffle_OBJ <-> wcore_OBJ. Reported-by: Emil Velikov Signed-off-by: Chad Versace --- src/waffle/api/waffle_config.c | 2 +- src/waffle/api/waffle_context.c | 2 +- src/waffle/api/waffle_display.c | 2 +- src/waffle/api/waffle_window.c | 2 +- src/waffle/cor

[waffle] [PATCH 01/33] cgl: use wcore_calloc helper

2014-07-07 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/waffle/cgl/cgl_config.m | 6 ++ src/waffle/cgl/cgl_context.m | 6 ++ src/waffle/cgl/cgl_display.m | 6 ++ src/waffle/cgl/cgl_platform.m | 6 ++ src/waffle/cgl/cgl_window.m | 6 ++ 5 files changed, 10 insertions(+), 20 deletions

[waffle] [PATCH 09/33] wflinfo: silence signed/unsigned comparison warning

2014-07-07 Thread Emil Velikov
The variable i is used as and compared vs unsigned int. Change it's type so silcence the compiler warning. Signed-off-by: Emil Velikov --- src/utils/wflinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c index 3508cc6..58

[waffle] [PATCH 18/33] core: convert wcore_error_unittest to c11 threads

2014-07-07 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/waffle/core/wcore_error_unittest.c | 40 +- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/waffle/core/wcore_error_unittest.c b/src/waffle/core/wcore_error_unittest.c index e5d6cba..722930a 100644 --- a/src

[waffle] [PATCH 15/33] c99: use strerror_s over strerror_r under Windows

2014-07-07 Thread Emil Velikov
. The issue is resolved in mingw-w64 master branch (Rev.6559), and stable (v3.x). Any version after mingw-w64-crt 3.1.0 should be OK (v3.1.0-2 if you're using Archlinux). v2: Update the commit message - Archlinux package 3.1.0-3 has the fix. v3: Move the definition to c99_compat.h Signed-off-by:

[waffle] [PATCH 28/33] examples/gl_basic: properly annotate the function pointers

2014-07-07 Thread Emil Velikov
Windows uses a different calling convention than linux for their public API (__stdcall vs __cdelc). Signed-off-by: Emil Velikov --- examples/gl_basic.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/examples/gl_basic.c b/examples/gl_basic.c index

[waffle] [PATCH 30/33] tests/gl_basic_test: properly annotate the function pointers

2014-07-07 Thread Emil Velikov
Windows uses a different calling convention than linux for their public API (__stdcall vs __cdelc). Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/tests/functional

[waffle] [PATCH 31/33] utils/wlfinfo: use define to provide buffer lenght

2014-07-07 Thread Emil Velikov
... as char buffer[const int] does not work under msvc. Signed-off-by: Emil Velikov --- src/utils/wflinfo.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c index a76f9fc..94ecfea 100644 --- a/src/utils/wflinfo.c +++ b/src

[waffle] [PATCH 21/33] tests/gl_basic_test: don't include posix headers when building for win32

2014-07-07 Thread Emil Velikov
Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 4 1 file changed, 4 insertions(+) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 035b221..928008b 100644 --- a/tests/functional/gl_basic_test.c +++ b/tests/functional/gl_basic_test.c

[waffle] [PATCH 23/33] examples/gl_basic: use native sleep functions

2014-07-07 Thread Emil Velikov
nanosleep does not exist under Windows, use Sleep instead. Signed-off-by: Emil Velikov --- examples/gl_basic.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/examples/gl_basic.c b/examples/gl_basic.c index 8e1a28c..28af1ca 100644 --- a/examples/gl_basic.c +++ b/examples

[waffle] [PATCH 27/33] examples/simple-x11-egl: properly annotate the function pointers

2014-07-07 Thread Emil Velikov
Windows uses a different calling convention than linux for their public API (__stdcall vs __cdelc). Properly annotate the pointers until waffle becomes aware how to deal with GL dispatch. Signed-off-by: Emil Velikov --- examples/simple-x11-egl.c | 12 ++-- 1 file changed, 10 insertions

[waffle] [PATCH 29/33] utils/wflinfo: properly annotate the function pointers

2014-07-07 Thread Emil Velikov
Windows uses a different calling convention than linux for their public API (__stdcall vs __cdelc). Signed-off-by: Emil Velikov --- src/utils/wflinfo.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c index 54ff7f6

[waffle] [PATCH 33/33] examples/gl_basic: move variable declaration before code

2014-07-07 Thread Emil Velikov
... this c99 feature finally works with msvc, but if the variable type is a typedef things explode miserably. Until it works properly move the declaration. Signed-off-by: Emil Velikov --- examples/gl_basic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples

[waffle] [PATCH 25/33] examples/gl_basic: use compiler specific (noreturn)

2014-07-07 Thread Emil Velikov
Signed-off-by: Emil Velikov --- examples/gl_basic.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/examples/gl_basic.c b/examples/gl_basic.c index 28af1ca..6a399bd 100644 --- a/examples/gl_basic.c +++ b/examples/gl_basic.c @@ -109,7 +109,15 @@ static const

[waffle] [PATCH 32/33] utils/wflinfo: wrap if (glHamSandwich() != GL_NO_ERROR ||...) is curly brackets

2014-07-07 Thread Emil Velikov
... as msvc preprocessor trips over itself and fails. Signed-off-by: Emil Velikov --- src/utils/wflinfo.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c index 94ecfea..9543918 100644 --- a/src/utils/wflinfo.c +++ b/src

[waffle] [PATCH 20/33] third_party/getopt: include BSD licensed getopt implementation

2014-07-07 Thread Emil Velikov
Used by utils/wflinfo and examples/gl_basic. Signed-off-by: Emil Velikov --- CMakeLists.txt| 8 + examples/CMakeLists.txt | 2 +- src/utils/CMakeLists.txt | 2 +- third_party/getopt/CMakeLists.txt | 10 + third_party/getopt/LICENSE| 45

[waffle] [PATCH 26/33] utils/wflinfo: use compiler specific (noreturn)

2014-07-07 Thread Emil Velikov
Signed-off-by: Emil Velikov --- src/utils/wflinfo.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c index 58028f9..54ff7f6 100644 --- a/src/utils/wflinfo.c +++ b/src/utils/wflinfo.c @@ -123,7 +123,15 @@ strneq(const

Re: [waffle] Some new and old fixes

2014-07-07 Thread Emil Velikov
On 07/07/14 18:28, Emil Velikov wrote: > Hi all, > > After respinning the latest changes (and ripping out WGL as it requires some > api/abi changes) here is a lovely list of fixes that gets us closer to > building > waffle with mingw/msvc. > > The first four patches

Re: [waffle] Some new and old fixes

2014-07-07 Thread Emil Velikov
On 07/07/14 17:57, Brian Paul wrote: > On 07/07/2014 11:28 AM, Emil Velikov wrote: >> Hi all, >> >> After respinning the latest changes (and ripping out WGL as it requires some >> api/abi changes) here is a lovely list of fixes that gets us closer to >> b

Re: [waffle] Some new and old fixes

2014-07-14 Thread Emil Velikov
On 07/07/14 18:28, Emil Velikov wrote: > Hi all, > > After respinning the latest changes (and ripping out WGL as it requires some > api/abi changes) here is a lovely list of fixes that gets us closer to > building > waffle with mingw/msvc. > > The first four patches

Re: [waffle] Some new and old fixes

2014-07-15 Thread Emil Velikov
On 15/07/14 15:35, Jose Fonseca wrote: > On 07/07/14 18:28, Emil Velikov wrote: >> Hi all, >> >> After respinning the latest changes (and ripping out WGL as it requires some >> api/abi changes) here is a lovely list of fixes that gets us closer to >> building >

Re: [waffle] Some new and old fixes

2014-07-15 Thread Emil Velikov
On 15/07/14 17:30, Jose Fonseca wrote: > On 15/07/14 17:22, Emil Velikov wrote: >> On 15/07/14 15:35, Jose Fonseca wrote: >>> On 07/07/14 18:28, Emil Velikov wrote: >>>> Hi all, >>>> >>>> After respinning the latest changes (and ripping out WG

Re: [waffle] Some new and old fixes

2014-07-16 Thread Emil Velikov
On 15 July 2014 19:09, Jose Fonseca wrote: > On 15/07/14 18:14, Emil Velikov wrote: >> >> On 15/07/14 17:30, Jose Fonseca wrote: [snip] >> I would appreciate if you can find out where SDKDDKVer.h and windows.h are >> located for the v120 toolset and which program prov

Re: [waffle] [PATCH 07/33] linux: plug a memory leak

2014-07-17 Thread Emil Velikov
On 17/07/14 04:45, Chad Versace wrote: > On 07/07/2014 10:28 AM, Emil Velikov wrote: > >> Chad, do you have a plan/idea how to handle this ? I'm assuming that >> your plan is to tackle this once waffle_init is gone/replaced with a >> better solution (issue #7

Re: [waffle] [PATCH 15/33] c99: use strerror_s over strerror_r under Windows

2014-07-17 Thread Emil Velikov
On 17/07/14 05:36, Chad Versace wrote: > On 07/07/2014 10:28 AM, Emil Velikov wrote: > >> +/* >> + * strerror_r (strictly speaking not C99) > ^^ > You documented what's wrong with defining strerror_r in a C99 > compatibil

Re: [waffle] [PATCH 09/33] wflinfo: silence signed/unsigned comparison warning

2014-07-17 Thread Emil Velikov
On 17/07/14 05:03, Chad Versace wrote: > On 07/07/2014 10:28 AM, Emil Velikov wrote: >> The variable i is used as and compared vs unsigned int. >> Change it's type so silcence the compiler warning. >> >> Signed-off-by: Emil Velikov >> --- >> src/

Re: [waffle] [PATCH 16/33] third_party/threads: import c11 threads emulation wrappers

2014-07-21 Thread Emil Velikov
On 17/07/14 05:40, Chad Versace wrote: > Emil, > > I'm finished reviewing for today, and am stopping here at patch 16. I'll > resume reviewing tomorrow. > > I see that you're collecting reviewed-by tags and cleanups on versioned > brancehs (for-upstream-3.*). I will defer cherry-picking patches o

Re: [waffle] [PATCH 09/33] wflinfo: silence signed/unsigned comparison warning

2014-07-22 Thread Emil Velikov
On 22/07/14 05:41, Chad Versace wrote: > On 07/17/2014 11:45 AM, Emil Velikov wrote: > >> I'll just use the original (above) patch, otherwise things are a bit too >> hairy. Continue reading if interested in my nitpicking: >> >> * GLuint is not defined (typedeff

[waffle] [PATCH 16.2/33] third_party/threads: use intptr_t for int<>void* typecasting

2014-07-22 Thread Emil Velikov
-cast] Signed-off-by: Emil Velikov --- AFAICS the warnings make things look scarier that what they truly are. Carry on reading for more details. The C11 threads API uses void* in order to be to move flexible while the POSIX threads uses int throughout. As we consistently typecast from void * to int

[waffle] [PATCH 16.1/33] third_party/threads: add missing brackets around _MTX_INITIALIZER_NP

2014-07-22 Thread Emil Velikov
... for win32 builds. Spotted by gcc(mingw-w64) src/waffle/core/wcore_display.c:37:5: warning: missing braces around initializer [-Wmissing-braces] static mtx_t mutex = _MTX_INITIALIZER_NP; ^ Signed-off-by: Emil Velikov --- third_party/threads/threads.h | 2 +- 1 file changed, 1

  1   2   3   4   5   6   >