]> git.sesse.net Git - vlc/blobdiff - include/vlc_common.h
LIBVLC_USED: tag for function whose result must be used
[vlc] / include / vlc_common.h
index 65158d04126fd3ed7fb988df553c05f2ebb0782d..d30e82a08e2f6d5f660c1b8a9bd9364cac04d36e 100644 (file)
 # include <stdbool.h>
 #endif
 
+/* Format string sanity checks */
+#ifdef __GNUC__
+#   define LIBVLC_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
+#   define LIBVLC_USED __attribute__ ((warn_unused_result))
+#else
+#   define LIBVLC_FORMAT(x,y)
+#   define LIBVLC_USED
+#endif
+
 /*****************************************************************************
  * Basic types definitions
  *****************************************************************************/
@@ -740,13 +749,6 @@ static inline uint64_t ntoh64 (uint64_t ll)
 }
 #define hton64(i) ntoh64(i)
 
-/* Format string sanity checks */
-#ifdef __GNUC__
-#   define LIBVLC_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
-#else
-#   define LIBVLC_FORMAT(x,y)
-#endif
-
 /* */
 #define VLC_UNUSED(x) (void)(x)