Revert previous break changes that return UC_ERR_ARG for non-existing registers

But print a warning instead
This commit is contained in:
mio
2024-10-02 15:49:26 +08:00
parent a637368122
commit 9f935f505e
11 changed files with 35 additions and 2 deletions

View File

@@ -154,4 +154,16 @@ static inline void uc_common_init(struct uc_struct* uc)
ret = UC_ERR_OK; \
} while(0)
#define CHECK_RET_DEPRECATE(ret, regid) do { \
if (ret == UC_ERR_ARG && !getenv("UC_IGNORE_REG_BREAK")) { \
fprintf(stderr, \
"WARNING: Your register accessing on id %"PRIu32" is deprecated" \
" and will get UC_ERR_ARG in the future release (2.2.0) because" \
" the accessing is either no-op or not defined." \
" Set UC_IGNORE_REG_BREAK=1 to ignore this warning.\n", \
regid); \
ret = UC_ERR_OK; \
} \
} while (0)
#endif