#ifndef __MDFN_CLAMP_H #define __MDFN_CLAMP_H #ifdef __cplusplus extern "C" { #endif #include #ifndef _WIN32 #include #endif static INLINE void clamp(int32_t *val, ssize_t min, ssize_t max) { if(*val < min) *val = min; if(*val > max) *val = max; } #ifdef __cplusplus } #endif #endif