From 0bf20d51336aef08850d0152a6e1501f4b733cf6 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 5 Oct 2017 12:06:49 -0700 Subject: Don't include "error_code.h" in edify/expr.h. Use forward declartion to avoid pull in the module that contains error_code.h (trying to move it into libotautil). Otherwise all the modules that include "edify/expr.h" need to depend on the module that exports error_code.h. .cpp sources should include "error_code.h" explicitly to use the enums. Test: lunch aosp_{angler,bullhead,dragon,fugu,sailfish}-userdebug; mmma bootable/recovery Change-Id: Ic82db2746c7deb866e8cdfb3c57e0b1ecc71c4dc --- edify/expr.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'edify/expr.cpp') diff --git a/edify/expr.cpp b/edify/expr.cpp index 54ab3325c..403162d6d 100644 --- a/edify/expr.cpp +++ b/edify/expr.cpp @@ -31,6 +31,8 @@ #include #include +#include "error_code.h" + // Functions should: // // - return a malloc()'d string @@ -416,8 +418,5 @@ Value* ErrorAbort(State* state, CauseCode cause_code, const char* format, ...) { return nullptr; } -State::State(const std::string& script, void* cookie) : - script(script), - cookie(cookie) { -} - +State::State(const std::string& script, void* cookie) + : script(script), cookie(cookie), error_code(kNoError), cause_code(kNoCause) {} -- cgit v1.2.3