Lib: MAX & MIN are now inlined functions

This commit is contained in:
CPunch 2022-05-18 14:12:20 -05:00
parent 3e60cc3c0f
commit f62363d4e4
1 changed files with 6 additions and 8 deletions

View File

@ -22,15 +22,13 @@
# define LAIKA_FORCEINLINE __forceinline
#endif
#define MIN(a, b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
LAIKA_FORCEINLINE int MIN(int a, int b) {
return a < b ? a : b;
}
#define MAX(a, b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
LAIKA_FORCEINLINE int MAX(int a, int b) {
return a > b ? a : b;
}
struct sLaika_peer;
struct sLaika_socket;