@@ -2,7 +2,7 @@ use std::ffi::c_void;
2
2
use std:: marker:: PhantomData ;
3
3
4
4
// 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" ) ) ) ]
6
6
use raw_window_handle:: HasRawWindowHandle ;
7
7
8
8
#[ cfg( target_os = "windows" ) ]
@@ -16,6 +16,11 @@ pub(crate) mod x11;
16
16
#[ cfg( target_os = "linux" ) ]
17
17
pub ( crate ) use self :: x11 as platform;
18
18
19
+ #[ cfg( target_os = "freebsd" ) ]
20
+ pub ( crate ) mod x11;
21
+ #[ cfg( target_os = "freebsd" ) ]
22
+ pub ( crate ) use self :: x11 as platform;
23
+
19
24
#[ cfg( target_os = "macos" ) ]
20
25
mod macos;
21
26
#[ cfg( target_os = "macos" ) ]
@@ -75,7 +80,7 @@ pub struct GlContext {
75
80
}
76
81
77
82
impl GlContext {
78
- #[ cfg( not( target_os = "linux" ) ) ]
83
+ #[ cfg( not( any ( target_os = "linux" , target_os = "freebsd" ) ) ) ]
79
84
pub ( crate ) unsafe fn create (
80
85
parent : & impl HasRawWindowHandle , config : GlConfig ,
81
86
) -> Result < GlContext , GlError > {
@@ -86,7 +91,7 @@ impl GlContext {
86
91
/// The X11 version needs to be set up in a different way compared to the Windows and macOS
87
92
/// versions. So the platform-specific versions should be used to construct the context within
88
93
/// 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" ) ) ]
90
95
pub ( crate ) fn new ( context : platform:: GlContext ) -> GlContext {
91
96
GlContext { context, phantom : PhantomData }
92
97
}
0 commit comments