]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
vlc_xml.h: reindent the standard header
[vlc] / include / vlc_common.h
index 4c8c5e92440c8455359aa4305f533a64524c9721..92eb50ce988980e685cee888502b3a3e33992056 100644 (file)
@@ -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 <windows.h>
 #endif
 
+#ifdef __OS2__
+#   define OS2EMX_PLAIN_CHAR
+#   define INCL_BASE
+#   define INCL_PM
+#   include <os2.h>
+#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)
@@ -914,6 +930,9 @@ static void vlc_free(void *ptr)
     if (ptr)
         free((char*)ptr - ((char*)ptr)[-1]);
 }
+#elif defined(__ANDROID__)
+# define vlc_memalign(align, size) memalign(align, size)
+# define vlc_free(base) free(base)
 #else
 static inline void *vlc_memalign(size_t align, size_t size)
 {