@@ -100,6 +100,40 @@ extern "C" {
100100# endif
101101#endif
102102
103+ #ifdef __has_attribute
104+ # if __has_attribute (deprecated )
105+ # define SENTRY_DEPRECATED (msg ) __attribute__((deprecated(msg)))
106+ # endif
107+ #endif
108+ #ifndef SENTRY_DEPRECATED
109+ # if defined(__GNUC__ ) \
110+ && (__GNUC__ > 4 \
111+ || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5 )) /* GCC 4.5 */
112+ # define SENTRY_DEPRECATED (msg ) __attribute__((deprecated(msg)))
113+ # elif defined(__clang__ ) && __clang__major__ >= 3 /* Clang 3.0 */
114+ # define SENTRY_DEPRECATED (msg ) __attribute__((deprecated(msg)))
115+ # elif defined(_MSC_VER ) && _MSC_VER >= 1400 /* VS 2005 (8.0) */
116+ # define SENTRY_DEPRECATED (msg ) __declspec(deprecated(msg))
117+ # else
118+ # define SENTRY_DEPRECATED (msg )
119+ # endif
120+ #endif
121+
122+ #if defined(__GNUC__ ) || defined(__clang__ )
123+ # define SENTRY_SUPPRESS_DEPRECATED \
124+ _Pragma("GCC diagnostic push"); \
125+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
126+ # define SENTRY_RESTORE_DEPRECATED _Pragma("GCC diagnostic pop")
127+ #elif defined(_MSC_VER )
128+ # define SENTRY_SUPPRESS_DEPRECATED \
129+ __pragma(warning(push)); \
130+ __pragma(warning(disable : 4996))
131+ # define SENTRY_RESTORE_DEPRECATED __pragma(warning(pop))
132+ #else
133+ # define SENTRY_SUPPRESS_DEPRECATED
134+ # define SENTRY_RESTORE_DEPRECATED
135+ #endif
136+
103137/* marks a function as experimental api */
104138#ifndef SENTRY_EXPERIMENTAL_API
105139# define SENTRY_EXPERIMENTAL_API SENTRY_API
@@ -515,13 +549,13 @@ SENTRY_EXPERIMENTAL_API char *sentry_value_to_msgpack(
515549 * Adds a stack trace to an event.
516550 *
517551 * The stack trace is added as part of a new thread object.
518- * This function is **deprecated** in favor of using
519- * `sentry_value_new_stacktrace` in combination with `sentry_value_new_thread`
520- * and `sentry_event_add_thread`.
521552 *
522553 * If `ips` is NULL the current stack trace is captured, otherwise `len`
523554 * stack trace instruction pointers are attached to the event.
524555 */
556+ SENTRY_DEPRECATED (
557+ "Use `sentry_value_new_stacktrace` in combination with "
558+ "`sentry_value_new_thread` and `sentry_event_add_thread` instead" )
525559SENTRY_EXPERIMENTAL_API void sentry_event_value_add_stacktrace (
526560 sentry_value_t event , void * * ips , size_t len );
527561
@@ -772,11 +806,8 @@ SENTRY_API void sentry_transport_free(sentry_transport_t *transport);
772806 * It is a convenience function which works with a borrowed `data`, and will
773807 * automatically free the envelope, so the user provided function does not need
774808 * to do that.
775- *
776- * This function is *deprecated* and will be removed in a future version.
777- * It is here for backwards compatibility. Users should migrate to the
778- * `sentry_transport_new` API.
779809 */
810+ SENTRY_DEPRECATED ("Use `sentry_transport_new` instead" )
780811SENTRY_API sentry_transport_t * sentry_new_function_transport (
781812 void (* func )(const sentry_envelope_t * envelope , void * data ), void * data );
782813
@@ -1053,13 +1084,13 @@ SENTRY_API const char *sentry_options_get_proxy(const sentry_options_t *opts);
10531084/**
10541085 * Configures the proxy.
10551086 *
1056- * This is a **deprecated** alias for `sentry_options_set_proxy(_n)`.
1057- *
10581087 * The given proxy has to include the full scheme,
10591088 * eg. `http://some.proxy/.
10601089 */
1090+ SENTRY_DEPRECATED ("Use `sentry_options_set_proxy` instead" )
10611091SENTRY_API void sentry_options_set_http_proxy (
10621092 sentry_options_t * opts , const char * proxy );
1093+ SENTRY_DEPRECATED ("Use `sentry_options_set_proxy_n` instead" )
10631094SENTRY_API void sentry_options_set_http_proxy_n (
10641095 sentry_options_t * opts , const char * proxy , size_t proxy_len );
10651096
@@ -1465,10 +1496,9 @@ SENTRY_API int sentry_close(void);
14651496/**
14661497 * Shuts down the sentry client and forces transports to flush out.
14671498 *
1468- * This is a **deprecated** alias for `sentry_close`.
1469- *
14701499 * Returns 0 on success.
14711500 */
1501+ SENTRY_DEPRECATED ("Use `sentry_close` instead" )
14721502SENTRY_API int sentry_shutdown (void );
14731503
14741504/**
@@ -2419,25 +2449,48 @@ SENTRY_EXPERIMENTAL_API void sentry_transaction_set_name_n(
24192449 sentry_transaction_t * transaction , const char * name , size_t name_len );
24202450
24212451/**
2422- * Creates a new User Feedback with a specific name, email and comments.
2452+ * Creates a deprecated User Report with a specific name, email and comments.
24232453 *
2424- * See https://develop.sentry.dev/sdk/envelopes/#user-feedback
2425- *
2426- * User Feedback has to be associated with a specific event that has been
2427- * sent to Sentry earlier.
2454+ * See
2455+ * https://develop.sentry.dev/sdk/data-model/envelope-items/#user-report---deprecated
24282456 */
2457+ SENTRY_DEPRECATED ("Use `sentry_value_new_feedback` instead" )
24292458SENTRY_API sentry_value_t sentry_value_new_user_feedback (
24302459 const sentry_uuid_t * uuid , const char * name , const char * email ,
24312460 const char * comments );
2461+ SENTRY_DEPRECATED ("Use `sentry_value_new_feedback_n` instead" )
24322462SENTRY_API sentry_value_t sentry_value_new_user_feedback_n (
24332463 const sentry_uuid_t * uuid , const char * name , size_t name_len ,
24342464 const char * email , size_t email_len , const char * comments ,
24352465 size_t comments_len );
24362466
2467+ /**
2468+ * Captures a deprecated User Report and sends it to Sentry.
2469+ */
2470+ SENTRY_DEPRECATED ("Use `sentry_capture_feedback` instead" )
2471+ SENTRY_API void sentry_capture_user_feedback (sentry_value_t user_report );
2472+
2473+ /**
2474+ * Creates a new User Feedback with a specific message (required), and optional
2475+ * contact_email, name, message, and associated_event_id.
2476+ *
2477+ * See https://develop.sentry.dev/sdk/data-model/envelope-items/#user-feedback
2478+ *
2479+ * User Feedback can be associated with a specific event that has been
2480+ * sent to Sentry earlier.
2481+ */
2482+ SENTRY_API sentry_value_t sentry_value_new_feedback (const char * message ,
2483+ const char * contact_email , const char * name ,
2484+ const sentry_uuid_t * associated_event_id );
2485+ SENTRY_API sentry_value_t sentry_value_new_feedback_n (const char * message ,
2486+ size_t message_len , const char * contact_email , size_t contact_email_len ,
2487+ const char * name , size_t name_len ,
2488+ const sentry_uuid_t * associated_event_id );
2489+
24372490/**
24382491 * Captures a manually created User Feedback and sends it to Sentry.
24392492 */
2440- SENTRY_API void sentry_capture_user_feedback (sentry_value_t user_feedback );
2493+ SENTRY_API void sentry_capture_feedback (sentry_value_t user_feedback );
24412494
24422495/**
24432496 * The status of a Span or Transaction.
@@ -2573,14 +2626,14 @@ SENTRY_EXPERIMENTAL_API const char *sentry_sdk_version(void);
25732626
25742627/**
25752628 * Sentry SDK name set during build time.
2576- * Deprecated: Please use sentry_options_get_sdk_name instead.
25772629 */
2630+ SENTRY_DEPRECATED ("Use `sentry_options_get_sdk_name` instead" )
25782631SENTRY_EXPERIMENTAL_API const char * sentry_sdk_name (void );
25792632
25802633/**
25812634 * Sentry SDK User-Agent set during build time.
2582- * Deprecated: Please use sentry_options_get_user_agent instead.
25832635 */
2636+ SENTRY_DEPRECATED ("Use `sentry_options_get_user_agent` instead" )
25842637SENTRY_EXPERIMENTAL_API const char * sentry_sdk_user_agent (void );
25852638
25862639#ifdef __cplusplus
0 commit comments