705abe2d30
This change provide a specialization of android::base::OkOrFail for status_t. As a result, a statement whose type is status_t can be used with OR_RETURN. The specialization also provides conversion operators to Result<T, StatusT> where StatusT is a wrapper type for status_t. This allows OR_RETURN macro to be used in newer functions that returns Result<T, StatusT>. Example usage: \#include <utils/ErrorsMacros.h> status_t legacy_inner(); status_t legacy_outer() { OR_RETURN(legacy_inner()); return OK; } Result<T, StatusT> new_outer() { OR_RETURN(legacy_inner()); // the same macro return T{...}; } Bug: 209929099 Test: atest libutils_test Change-Id: I0def0e84ce3f0c4ff6d508c202bd51902dfc9618 |
||
---|---|---|
.. | ||
AndroidThreads.h | ||
Atomic.h | ||
BitSet.h | ||
ByteOrder.h | ||
CallStack.h | ||
Compat.h | ||
Condition.h | ||
Debug.h | ||
Endian.h | ||
Errors.h | ||
ErrorsMacros.h | ||
FastStrcmp.h | ||
FileMap.h | ||
Flattenable.h | ||
Functor.h | ||
JenkinsHash.h | ||
KeyedVector.h | ||
LightRefBase.h | ||
List.h | ||
Log.h | ||
Looper.h | ||
LruCache.h | ||
misc.h | ||
Mutex.h | ||
NativeHandle.h | ||
Printer.h | ||
ProcessCallStack.h | ||
RefBase.h | ||
RWLock.h | ||
Singleton.h | ||
SortedVector.h | ||
StopWatch.h | ||
String8.h | ||
String16.h | ||
StrongPointer.h | ||
SystemClock.h | ||
Thread.h | ||
ThreadDefs.h | ||
threads.h | ||
Timers.h | ||
Tokenizer.h | ||
Trace.h | ||
TypeHelpers.h | ||
Unicode.h | ||
Vector.h | ||
VectorImpl.h |