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.h | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'edify/expr.h') diff --git a/edify/expr.h b/edify/expr.h index 4838d20c0..32828028a 100644 --- a/edify/expr.h +++ b/edify/expr.h @@ -23,32 +23,34 @@ #include #include -#include "error_code.h" +// Forward declaration to avoid including "error_code.h". +enum ErrorCode : int; +enum CauseCode : int; struct State { - State(const std::string& script, void* cookie); + State(const std::string& script, void* cookie); - // The source of the original script. - const std::string& script; + // The source of the original script. + const std::string& script; - // Optional pointer to app-specific data; the core of edify never - // uses this value. - void* cookie; + // Optional pointer to app-specific data; the core of edify never + // uses this value. + void* cookie; - // The error message (if any) returned if the evaluation aborts. - // Should be empty initially, will be either empty or a string that - // Evaluate() returns. - std::string errmsg; + // The error message (if any) returned if the evaluation aborts. + // Should be empty initially, will be either empty or a string that + // Evaluate() returns. + std::string errmsg; - // error code indicates the type of failure (e.g. failure to update system image) - // during the OTA process. - ErrorCode error_code = kNoError; + // error code indicates the type of failure (e.g. failure to update system image) + // during the OTA process. + ErrorCode error_code; - // cause code provides more detailed reason of an OTA failure (e.g. fsync error) - // in addition to the error code. - CauseCode cause_code = kNoCause; + // cause code provides more detailed reason of an OTA failure (e.g. fsync error) + // in addition to the error code. + CauseCode cause_code; - bool is_retry = false; + bool is_retry = false; }; enum ValueType { -- cgit v1.2.3