12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #ifndef DETOURSTATUS_H
- #define DETOURSTATUS_H
- typedef unsigned int dtStatus;
- static const unsigned int DT_FAILURE = 1u << 31;
- static const unsigned int DT_SUCCESS = 1u << 30;
- static const unsigned int DT_IN_PROGRESS = 1u << 29;
- static const unsigned int DT_STATUS_DETAIL_MASK = 0x0ffffff;
- static const unsigned int DT_WRONG_MAGIC = 1 << 0;
- static const unsigned int DT_WRONG_VERSION = 1 << 1;
- static const unsigned int DT_OUT_OF_MEMORY = 1 << 2;
- static const unsigned int DT_INVALID_PARAM = 1 << 3;
- static const unsigned int DT_BUFFER_TOO_SMALL = 1 << 4;
- static const unsigned int DT_OUT_OF_NODES = 1 << 5;
- static const unsigned int DT_PARTIAL_RESULT = 1 << 6;
- inline bool dtStatusSucceed(dtStatus status)
- {
- return (status & DT_SUCCESS) != 0;
- }
- inline bool dtStatusFailed(dtStatus status)
- {
- return (status & DT_FAILURE) != 0;
- }
- inline bool dtStatusInProgress(dtStatus status)
- {
- return (status & DT_IN_PROGRESS) != 0;
- }
- inline bool dtStatusDetail(dtStatus status, unsigned int detail)
- {
- return (status & detail) != 0;
- }
- #endif
|