From 3c680aede1d3c29405db9d8418620b7552279e04 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Sun, 19 Jan 2014 15:17:19 -0800 Subject: wflinfo: Build on Mac I tested that wflinfo doesn't break the build on Mac. Despite building, though, it doesn't work. Signed-off-by: Chad Versace --- src/utils/CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 652575b..5bdf9c4 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -2,14 +2,6 @@ # Target: wflinfo (executable) # ---------------------------------------------------------------------------- -if(waffle_on_mac) - # TODO(chadv,due:waffle-1.4): Enable wflinfo on Mac. - # - # No one has yet verified that wflinfo successfully builds on Mac. Since it - # may break the build, we simply disable it for now. - return() -endif() - add_executable(wflinfo wflinfo.c) target_link_libraries(wflinfo ${waffle_libname}) set_target_properties(wflinfo -- cgit v1.2.3 From ea347c6659803d8deba3982e9009cb721c8f4915 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Sun, 19 Jan 2014 15:43:36 -0800 Subject: cgl: Make waffle_get_proc_address() work There is no CGLGetProcAddress, so waffle_get_proc_address() always emitted an error. However, this patch changes it to follow the principle of least surprise. The only supported API on CGL is OpenGL, so assume the user called waffle_get_proc_address() to obtain an OpenGL function pointer and get it with dlsym(). Signed-off-by: Chad Versace --- src/waffle/cgl/cgl_platform.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/waffle/cgl/cgl_platform.m b/src/waffle/cgl/cgl_platform.m index ee3a23b..fa82041 100644 --- a/src/waffle/cgl/cgl_platform.m +++ b/src/waffle/cgl/cgl_platform.m @@ -148,11 +148,13 @@ cgl_make_current(struct wcore_platform *wc_self, } static void* -cgl_get_proc_address(struct wcore_platform *wc_self, - const char *name) +cgl_get_proc_address(struct wcore_platform *wc_self, const char *name) { - // There is no CGLGetProcAddress. - return NULL; + // There is no CGLGetProcAddress. However, Waffle follows the principle of + // least surprise here. The only supported API on CGL is OpenGL, so assume + // the user called waffle_get_proc_address() to obtain an OpenGL function + // pointer. + return cgl_dl_sym(wc_self, WAFFLE_DL_OPENGL, name); } static const struct wcore_platform_vtbl cgl_platform_vtbl = { -- cgit v1.2.3