about summary refs log tree commit diff stats
path: root/053recipe_header.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-24 08:57:45 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-24 08:57:45 -0700
commitae9db5a45f5e6bbee363fb0cd0a75a904d913b7b (patch)
treea35afd62e18c4b026e0703fe04f2136aa0402216 /053recipe_header.cc
parent87eb3acae90e0c7a36562da1bc930e03f1e12cb7 (diff)
downloadmu-ae9db5a45f5e6bbee363fb0cd0a75a904d913b7b.tar.gz
3587
Another CI fix.
Diffstat (limited to '053recipe_header.cc')
-rw-r--r--053recipe_header.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/053recipe_header.cc b/053recipe_header.cc
index e6cc51d9..87b018c8 100644
--- a/053recipe_header.cc
+++ b/053recipe_header.cc
@@ -248,6 +248,15 @@ def foo a:num [
 if (is_present_in_ingredients(get(Recipe, get(Recipe_ordinal, recipe_name)), x.name))
   raise << "  did you forget 'load-ingredients'?\n" << end();
 
+:(code)
+bool is_present_in_ingredients(const recipe& callee, const string& ingredient_name) {
+  for (int i = 0;  i < SIZE(callee.ingredients);  ++i) {
+    if (callee.ingredients.at(i).name == ingredient_name)
+      return true;
+  }
+  return false;
+}
+
 //:: Check all calls against headers.
 
 :(scenario show_clear_error_on_bad_call)