mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
keys: don't remove deprecated symbols by default
Add a new macro to mark deprecated keys. The macro will emit a warning about the symbol being deprecated. PW_ENABLE_DEPRECATED will suppress the deprecation warning. Add PW_REMOVE_DEPRECATED to completely remove the deprecated symbols. Fixes #2952
This commit is contained in:
parent
ccedf1722a
commit
a979c0f430
2 changed files with 12 additions and 5 deletions
|
|
@ -29,6 +29,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <pipewire/utils.h>
|
||||
/**
|
||||
* \defgroup pw_keys Key Names
|
||||
*
|
||||
|
|
@ -337,14 +338,14 @@ extern "C" {
|
|||
#define PW_KEY_VIDEO_FORMAT "video.format" /**< a video format */
|
||||
#define PW_KEY_VIDEO_SIZE "video.size" /**< a video size as "<width>x<height" */
|
||||
|
||||
#ifdef PW_ENABLE_DEPRECATED
|
||||
#define PW_KEY_PRIORITY_MASTER "priority.master" /**< deprecated */
|
||||
#define PW_KEY_NODE_TARGET "node.target" /**< deprecated since 0.3.64, use target.object. */
|
||||
#endif /* PW_ENABLE_DEPRECATED */
|
||||
|
||||
#define PW_KEY_TARGET_OBJECT "target.object" /**< a target object to link to. This can be
|
||||
* and object name or object.serial */
|
||||
|
||||
#ifndef PW_REMOVE_DEPRECATED
|
||||
#define PW_KEY_PRIORITY_MASTER PW_DEPRECATED("priority.master") /**< deprecated, use priority.driver */
|
||||
#define PW_KEY_NODE_TARGET PW_DEPRECATED("node.target") /**< deprecated since 0.3.64, use target.object. */
|
||||
#endif /* PW_REMOVE_DEPRECATED */
|
||||
|
||||
/** \}
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -94,6 +94,12 @@ ssize_t pw_getrandom(void *buf, size_t buflen, unsigned int flags);
|
|||
|
||||
void* pw_reallocarray(void *ptr, size_t nmemb, size_t size);
|
||||
|
||||
#ifdef PW_ENABLE_DEPRECATED
|
||||
#define PW_DEPRECATED(v) (v)
|
||||
#else
|
||||
#define PW_DEPRECATED(v) ({ __typeof__(v) _v SPA_DEPRECATED = (v); (void)_v; (v); })
|
||||
#endif /* PW_ENABLE_DEPRECATED */
|
||||
|
||||
/**
|
||||
* \}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue