File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,6 +186,29 @@ conf.set10(
186186 description : ' Is linux/mctp.h include-able?'
187187)
188188
189+ if meson .version().version_compare(' >= 0.48' )
190+ has_fallthrough = cc.has_function_attribute(' fallthrough' )
191+ else
192+ has_fallthrough = cc.compiles(
193+ ''' int main(int argc, char **argv) {
194+ switch(argc) {
195+ case 0:
196+ __attribute__((__fallthrough__));
197+ case 1:
198+ return 1;
199+ }
200+ return 0;
201+ }
202+ ''' ,
203+ name : ' has fallthrough' )
204+ endif
205+
206+ if has_fallthrough
207+ conf.set(' fallthrough' , ' __attribute__((__fallthrough__))' )
208+ else
209+ conf.set(' fallthrough' , ' do {} while (0) /* fallthrough */' )
210+ endif
211+
189212################################################################################
190213substs = configuration_data ()
191214substs.set(' NAME' , meson .project_name())
Original file line number Diff line number Diff line change 1717 * libnvme utility functions
1818 */
1919
20- #if __has_attribute (__fallthrough__ )
21- # define fallthrough __attribute__((__fallthrough__))
22- #else
23- # define fallthrough do {} while (0) /* fallthrough */
24- #endif
25-
2620/**
2721 * enum nvme_connect_err - nvme connect error codes
2822 * @ENVME_CONNECT_RESOLVE: failed to resolve host
You can’t perform that action at this time.
0 commit comments