mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-06 04:38:04 +02:00
Fixed DEPRECATE macro so that old programs will still work
This commit is contained in:
parent
bbe8f9330b
commit
66c091e706
2 changed files with 6 additions and 4 deletions
|
|
@ -532,6 +532,7 @@ cairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y);
|
|||
deprecated functions to continue to work for now, (with useful
|
||||
warnings). But the deprecated functions will not appear in the next
|
||||
release. */
|
||||
#ifndef _CAIROINT_H_
|
||||
#define cairo_get_operator cairo_get_operator_DEPRECATED_BY_cairo_current_operator
|
||||
#define cairo_get_rgb_color cairo_get_rgb_color_DEPRECATED_BY_cairo_current_rgb_color
|
||||
#define cairo_get_alpha cairo_get_alpha_DEPRECATED_BY_cairo_current_alpha
|
||||
|
|
@ -546,6 +547,7 @@ cairo_matrix_transform_point (cairo_matrix_t *matrix, double *x, double *y);
|
|||
#define cairo_get_target_surface cairo_get_target_surface_DEPRECATED_BY_cairo_current_target_surface
|
||||
#define cairo_get_status cairo_get_status_DEPRECATED_BY_cairo_status
|
||||
#define cairo_get_status_string cairo_get_status_string_DEPRECATED_BY_cairo_status_string
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@
|
|||
If the macro is not supported by the compiler, the program will not
|
||||
link, and the user will still se a useful error message. */
|
||||
#if __GNUC__ >= 2 && defined(__ELF__)
|
||||
# define DEPRECATE(old, new) DEPRECATE_INT(old, old##_DEPRECATED_BY_##new , new)
|
||||
# define DEPRECATE_INT(old, int, new) \
|
||||
extern __typeof (new) int \
|
||||
__asm__ ("" #int) \
|
||||
# define DEPRECATE(old, new) ADD_ALIAS(old, new); ADD_ALIAS(old##_DEPRECATED_BY_##new , new)
|
||||
# define ADD_ALIAS(old, new) \
|
||||
extern __typeof (new) old \
|
||||
__asm__ ("" #old) \
|
||||
__attribute__((__alias__("" #new)))
|
||||
#else
|
||||
# define DEPRECATE(old, new)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue