@@ -10,31 +10,13 @@ extern crate core;
10
10
mod cg;
11
11
#[ cfg( target_os = "redox" ) ]
12
12
mod orbital;
13
- #[ cfg( all(
14
- feature = "wayland" ,
15
- any(
16
- target_os = "linux" ,
17
- target_os = "freebsd" ,
18
- target_os = "dragonfly" ,
19
- target_os = "netbsd" ,
20
- target_os = "openbsd"
21
- )
22
- ) ) ]
13
+ #[ cfg( wayland_platform) ]
23
14
mod wayland;
24
15
#[ cfg( target_arch = "wasm32" ) ]
25
16
mod web;
26
17
#[ cfg( target_os = "windows" ) ]
27
18
mod win32;
28
- #[ cfg( all(
29
- feature = "x11" ,
30
- any(
31
- target_os = "linux" ,
32
- target_os = "freebsd" ,
33
- target_os = "dragonfly" ,
34
- target_os = "netbsd" ,
35
- target_os = "openbsd"
36
- )
37
- ) ) ]
19
+ #[ cfg( x11_platform) ]
38
20
mod x11;
39
21
40
22
mod error;
@@ -84,9 +66,9 @@ macro_rules! make_dispatch {
84
66
}
85
67
86
68
make_dispatch ! {
87
- #[ cfg( all ( feature = "x11" , any ( target_os = "linux" , target_os = "freebsd" , target_os = "dragonfly" , target_os = "netbsd" , target_os = "openbsd" ) ) ) ]
69
+ #[ cfg( x11_platform ) ]
88
70
X11 ( x11:: X11Impl ) ,
89
- #[ cfg( all ( feature = "wayland" , any ( target_os = "linux" , target_os = "freebsd" , target_os = "dragonfly" , target_os = "netbsd" , target_os = "openbsd" ) ) ) ]
71
+ #[ cfg( wayland_platform ) ]
90
72
Wayland ( wayland:: WaylandImpl ) ,
91
73
#[ cfg( target_os = "windows" ) ]
92
74
Win32 ( win32:: Win32Impl ) ,
@@ -123,48 +105,21 @@ impl GraphicsContext {
123
105
raw_display_handle : RawDisplayHandle ,
124
106
) -> Result < Self , SwBufError > {
125
107
let imple: Dispatch = match ( raw_window_handle, raw_display_handle) {
126
- #[ cfg( all(
127
- feature = "x11" ,
128
- any(
129
- target_os = "linux" ,
130
- target_os = "freebsd" ,
131
- target_os = "dragonfly" ,
132
- target_os = "netbsd" ,
133
- target_os = "openbsd"
134
- )
135
- ) ) ]
108
+ #[ cfg( x11_platform) ]
136
109
(
137
110
RawWindowHandle :: Xlib ( xlib_window_handle) ,
138
111
RawDisplayHandle :: Xlib ( xlib_display_handle) ,
139
112
) => Dispatch :: X11 ( unsafe {
140
113
x11:: X11Impl :: from_xlib ( xlib_window_handle, xlib_display_handle) ?
141
114
} ) ,
142
- #[ cfg( all(
143
- feature = "x11" ,
144
- any(
145
- target_os = "linux" ,
146
- target_os = "freebsd" ,
147
- target_os = "dragonfly" ,
148
- target_os = "netbsd" ,
149
- target_os = "openbsd"
150
- )
151
- ) ) ]
115
+ #[ cfg( x11_platform) ]
152
116
(
153
117
RawWindowHandle :: Xcb ( xcb_window_handle) ,
154
118
RawDisplayHandle :: Xcb ( xcb_display_handle) ,
155
119
) => Dispatch :: X11 ( unsafe {
156
120
x11:: X11Impl :: from_xcb ( xcb_window_handle, xcb_display_handle) ?
157
121
} ) ,
158
- #[ cfg( all(
159
- feature = "wayland" ,
160
- any(
161
- target_os = "linux" ,
162
- target_os = "freebsd" ,
163
- target_os = "dragonfly" ,
164
- target_os = "netbsd" ,
165
- target_os = "openbsd"
166
- )
167
- ) ) ]
122
+ #[ cfg( wayland_platform) ]
168
123
(
169
124
RawWindowHandle :: Wayland ( wayland_window_handle) ,
170
125
RawDisplayHandle :: Wayland ( wayland_display_handle) ,
0 commit comments