mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 23:21:07 +00:00
util: Fix MIN_NON_ZERO
MIN_NON_ZERO(1, 0) is evaluated to 0. Rewrite the macro to fix it. Backports commit b6ece2c6f37926a994bc564a9e55ef3be6016d8f from qemu
This commit is contained in:
parent
1781d5cfa6
commit
5c739f14f5
|
@ -134,7 +134,8 @@
|
|||
/* Minimum function that returns zero only iff both values are zero.
|
||||
* Intended for use with unsigned values only. */
|
||||
#ifndef MIN_NON_ZERO
|
||||
#define MIN_NON_ZERO(a, b) (((a) != 0 && (a) < (b)) ? (a) : (b))
|
||||
#define MIN_NON_ZERO(a, b) ((a) == 0 ? (b) : \
|
||||
((b) == 0 ? (a) : (MIN(a, b))))
|
||||
#endif
|
||||
|
||||
/* Round number down to multiple */
|
||||
|
|
Loading…
Reference in a new issue