[gvfs/wip/oholy/meson-version] build: Use break in foreach loop



commit 1115ef171d8bc3676c589f83147d48d36fdb0c29
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Thu Apr 4 15:28:13 2019 +0200

    build: Use break in foreach loop
    
    Since meson 0.49.0, `break` keyword can be used inside loops.
    
    This feature has been used to stop when checking functions in
    headers that makes avoiding loop iterations.
    
    [0] http://mesonbuild.com/Release-notes-for-0-49-0.html#foreach-break-and-continue

 meson.build | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index dae1522c..6d2bc356 100644
--- a/meson.build
+++ b/meson.build
@@ -170,7 +170,10 @@ foreach name: ['mkdev', 'sysmacros']
   have_major = true
   header = 'sys/@0@.h'.format(name)
   foreach func: ['major', 'minor', 'makedev']
-    have_major = have_major and cc.has_header_symbol(header, func)
+    if not cc.has_header_symbol(header, func)
+      have_major = false
+      break
+    endif
   endforeach
 
   config_h.set10('MAJOR_IN_' + name.to_upper(), have_major)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]