X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_common.h;h=92eb50ce988980e685cee888502b3a3e33992056;hb=c1cdd9154cb857a9886d28e9deb8d27b41c1f8e1;hp=a6f3534ee3a704937949443bd6407a1ab8858ddc;hpb=278a69e81f77c2e6af34a24787bd9307dc207040;p=vlc diff --git a/include/vlc_common.h b/include/vlc_common.h index a6f3534ee3..92eb50ce98 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -76,8 +76,8 @@ #define PRIo64 "llo" #undef PRIx64 #define PRIx64 "llx" - #define snprintf __mingw_snprintf - #define vsnprintf __mingw_vsnprintf + #define snprintf __mingw_snprintf + #define vsnprintf __mingw_vsnprintf #endif /* Function attributes for compiler warnings */ @@ -478,6 +478,13 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */ # include #endif +#ifdef __OS2__ +# define OS2EMX_PLAIN_CHAR +# define INCL_BASE +# define INCL_PM +# include +#endif + #include "vlc_mtime.h" #include "vlc_threads.h" @@ -572,6 +579,9 @@ VLC_API void vlc_release(gc_object_t *); # define __MIN(a, b) ( ((a) < (b)) ? (a) : (b) ) #endif +/* clip v in [min, max] */ +#define VLC_CLIP(v, min, max) __MIN(__MAX((v), (min)), (max)) + VLC_USED static inline int64_t GCD ( int64_t a, int64_t b ) { @@ -632,6 +642,12 @@ static inline unsigned popcount (unsigned x) #endif } +#ifdef __OS2__ +# undef bswap16 +# undef bswap32 +# undef bswap64 +#endif + /** Byte swap (16 bits) */ VLC_USED static inline uint16_t bswap16 (uint16_t x)