From ae9db5a45f5e6bbee363fb0cd0a75a904d913b7b Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 24 Oct 2016 08:57:45 -0700 Subject: 3587 Another CI fix. --- 053recipe_header.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to '053recipe_header.cc') 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) -- cgit 1.4.1-2-gfad0