@@ -2,7 +2,7 @@ use std::ffi::c_void;
22use std:: marker:: PhantomData ;
33
44// On X11 creating the context is a two step process
5- #[ cfg( not( target_os = "linux" ) ) ]
5+ #[ cfg( not( any ( target_os = "linux" , target_os = "freebsd" ) ) ) ]
66use raw_window_handle:: HasRawWindowHandle ;
77
88#[ cfg( target_os = "windows" ) ]
@@ -16,6 +16,11 @@ pub(crate) mod x11;
1616#[ cfg( target_os = "linux" ) ]
1717pub ( crate ) use self :: x11 as platform;
1818
19+ #[ cfg( target_os = "freebsd" ) ]
20+ pub ( crate ) mod x11;
21+ #[ cfg( target_os = "freebsd" ) ]
22+ pub ( crate ) use self :: x11 as platform;
23+
1924#[ cfg( target_os = "macos" ) ]
2025mod macos;
2126#[ cfg( target_os = "macos" ) ]
@@ -75,7 +80,7 @@ pub struct GlContext {
7580}
7681
7782impl GlContext {
78- #[ cfg( not( target_os = "linux" ) ) ]
83+ #[ cfg( not( any ( target_os = "linux" , target_os = "freebsd" ) ) ) ]
7984 pub ( crate ) unsafe fn create (
8085 parent : & impl HasRawWindowHandle , config : GlConfig ,
8186 ) -> Result < GlContext , GlError > {
@@ -86,7 +91,7 @@ impl GlContext {
8691 /// The X11 version needs to be set up in a different way compared to the Windows and macOS
8792 /// versions. So the platform-specific versions should be used to construct the context within
8893 /// baseview, and then this object can be passed to the user.
89- #[ cfg( target_os = "linux" ) ]
94+ #[ cfg( any ( target_os = "linux" , target_os = "freebsd" ) ) ]
9095 pub ( crate ) fn new ( context : platform:: GlContext ) -> GlContext {
9196 GlContext { context, phantom : PhantomData }
9297 }
0 commit comments