@@ -5,6 +5,9 @@ use std::marker::PhantomData;
5
5
#[ cfg( not( target_os = "linux" ) ) ]
6
6
use raw_window_handle:: HasRawWindowHandle ;
7
7
8
+ #[ cfg( not( target_os = "freebsd" ) ) ]
9
+ use raw_window_handle:: HasRawWindowHandle ;
10
+
8
11
#[ cfg( target_os = "windows" ) ]
9
12
mod win;
10
13
#[ cfg( target_os = "windows" ) ]
@@ -16,6 +19,11 @@ pub(crate) mod x11;
16
19
#[ cfg( target_os = "linux" ) ]
17
20
pub ( crate ) use self :: x11 as platform;
18
21
22
+ #[ cfg( target_os = "freebsd" ) ]
23
+ pub ( crate ) mod x11;
24
+ #[ cfg( target_os = "freebsd" ) ]
25
+ pub ( crate ) use self :: x11 as platform;
26
+
19
27
#[ cfg( target_os = "macos" ) ]
20
28
mod macos;
21
29
#[ cfg( target_os = "macos" ) ]
@@ -75,7 +83,7 @@ pub struct GlContext {
75
83
}
76
84
77
85
impl GlContext {
78
- #[ cfg( not( target_os = "linux" ) ) ]
86
+ #[ cfg( not( any ( target_os = "linux" , target_os = "freebsd" ) ) ) ]
79
87
pub ( crate ) unsafe fn create (
80
88
parent : & impl HasRawWindowHandle , config : GlConfig ,
81
89
) -> Result < GlContext , GlError > {
@@ -86,7 +94,7 @@ impl GlContext {
86
94
/// The X11 version needs to be set up in a different way compared to the Windows and macOS
87
95
/// versions. So the platform-specific versions should be used to construct the context within
88
96
/// baseview, and then this object can be passed to the user.
89
- #[ cfg( target_os = "linux" ) ]
97
+ #[ cfg( any ( target_os = "linux" , target_os = "freebsd" ) ) ]
90
98
pub ( crate ) fn new ( context : platform:: GlContext ) -> GlContext {
91
99
GlContext { context, phantom : PhantomData }
92
100
}
0 commit comments