summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOneric <oneric@oneric.stub>2020-08-15 01:06:53 +0200
committerOleg Oshmyan <chortos@inbox.lv>2020-09-08 12:57:48 +0300
commit42aa6ee392a25a5f699c44bca329fd6363879779 (patch)
tree57b83f55146948a7b62df3de25009c6097c3b518
parente52ae4d1d326804574c90de1072873e848261508 (diff)
downloadlibass-42aa6ee392a25a5f699c44bca329fd6363879779.tar.bz2
libass-42aa6ee392a25a5f699c44bca329fd6363879779.tar.xz
ass.h: Mark deprecated declarations as deprecated
GCC, Clang and MSVC now issue a warning when deprecated API is used.
-rw-r--r--libass/ass.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/libass/ass.h b/libass/ass.h
index db67ed2..0dcd17b 100644
--- a/libass/ass.h
+++ b/libass/ass.h
@@ -30,6 +30,22 @@
extern "C" {
#endif
+#if (defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) || defined(__clang__)
+ #define ASS_DEPRECATED(msg) __attribute__((deprecated(msg)))
+ #if __GNUC__ > 5 || defined(__clang__)
+ #define ASS_DEPRECATED_ENUM(msg) __attribute__((deprecated(msg)))
+ #else
+ #define ASS_DEPRECATED_ENUM(msg)
+ #endif
+#elif defined(_MSC_VER)
+ #define ASS_DEPRECATED(msg) __declspec(deprecated(msg))
+ #define ASS_DEPRECATED_ENUM(msg)
+#else
+ #define ASS_DEPRECATED(msg)
+ #define ASS_DEPRECATED_ENUM(msg)
+#endif
+
+
/*
* A linked list of images produced by an ass renderer.
*
@@ -129,7 +145,7 @@ typedef enum {
/**
* Old alias for ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE. Deprecated. Do not use.
*/
- ASS_OVERRIDE_BIT_FONT_SIZE = 1 << 1,
+ ASS_OVERRIDE_BIT_FONT_SIZE ASS_DEPRECATED_ENUM("replaced by ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE") = 1 << 1,
/**
* On dialogue events override: FontSize, Spacing, Blur, ScaleX, ScaleY
*/
@@ -402,7 +418,7 @@ void ass_set_pixel_aspect(ASS_Renderer *priv, double par);
* \param dar display aspect ratio (DAR), prescaled for output PAR
* \param sar storage aspect ratio (SAR)
*/
-void ass_set_aspect_ratio(ASS_Renderer *priv, double dar, double sar);
+ASS_DEPRECATED("use 'ass_set_pixel_aspect' instead") void ass_set_aspect_ratio(ASS_Renderer *priv, double dar, double sar);
/**
* \brief Set a fixed font scaling factor.
@@ -501,7 +517,7 @@ void ass_set_selective_style_override(ASS_Renderer *priv, ASS_Style *style);
* \param priv renderer handle
* \return success
*/
-int ass_fonts_update(ASS_Renderer *priv);
+ASS_DEPRECATED("it does nothing") int ass_fonts_update(ASS_Renderer *priv);
/**
* \brief Set hard cache limits. Do not set, or set to zero, for reasonable