From 7ef34eb06de54dd9186d3d21a401b2ef819b59e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 24 Apr 2018 15:37:23 +0200 Subject: [PATCH] X11: Add support for Cygwin/X sonames --- src/x11_init.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/x11_init.c b/src/x11_init.c index bff90e7c..c949916d 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -479,7 +479,11 @@ static GLFWbool initExtensions(void) &_glfw.x11.vidmode.errorBase); } +#if defined(__CYGWIN__) + _glfw.x11.xi.handle = _glfw_dlopen("libXi-6.so"); +#else _glfw.x11.xi.handle = _glfw_dlopen("libXi.so.6"); +#endif if (_glfw.x11.xi.handle) { _glfw.x11.xi.QueryVersion = (PFN_XIQueryVersion) @@ -505,7 +509,11 @@ static GLFWbool initExtensions(void) } } +#if defined(__CYGWIN__) + _glfw.x11.randr.handle = _glfw_dlopen("libXrandr-2.so"); +#else _glfw.x11.randr.handle = _glfw_dlopen("libXrandr.so.2"); +#endif if (_glfw.x11.randr.handle) { _glfw.x11.randr.AllocGamma = (PFN_XRRAllocGamma) @@ -593,7 +601,11 @@ static GLFWbool initExtensions(void) RROutputChangeNotifyMask); } +#if defined(__CYGWIN__) + _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor-1.so"); +#else _glfw.x11.xcursor.handle = _glfw_dlopen("libXcursor.so.1"); +#endif if (_glfw.x11.xcursor.handle) { _glfw.x11.xcursor.ImageCreate = (PFN_XcursorImageCreate) @@ -604,7 +616,11 @@ static GLFWbool initExtensions(void) _glfw_dlsym(_glfw.x11.xcursor.handle, "XcursorImageLoadCursor"); } +#if defined(__CYGWIN__) + _glfw.x11.xinerama.handle = _glfw_dlopen("libXinerama-1.so"); +#else _glfw.x11.xinerama.handle = _glfw_dlopen("libXinerama.so.1"); +#endif if (_glfw.x11.xinerama.handle) { _glfw.x11.xinerama.IsActive = (PFN_XineramaIsActive) @@ -644,14 +660,22 @@ static GLFWbool initExtensions(void) } } +#if defined(__CYGWIN__) + _glfw.x11.x11xcb.handle = _glfw_dlopen("libX11-xcb-1.so"); +#else _glfw.x11.x11xcb.handle = _glfw_dlopen("libX11-xcb.so.1"); +#endif if (_glfw.x11.x11xcb.handle) { _glfw.x11.x11xcb.GetXCBConnection = (PFN_XGetXCBConnection) _glfw_dlsym(_glfw.x11.x11xcb.handle, "XGetXCBConnection"); } +#if defined(__CYGWIN__) + _glfw.x11.xrender.handle = _glfw_dlopen("libXrender-1.so"); +#else _glfw.x11.xrender.handle = _glfw_dlopen("libXrender.so.1"); +#endif if (_glfw.x11.xrender.handle) { _glfw.x11.xrender.QueryExtension = (PFN_XRenderQueryExtension)