1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-04 21:04:18 +01:00

wrlib: re-introduce the optimize_for_speed flag for binary compatibility

The commit #d1f9b801 removed it because the code behind it is actually
useless, unfortunately removing the flag itself from the structure is
breaking the compatibility of the API.

To avoid problems, this patch re-introduces the flag in the structure, but
not the code behind it so it is useless, and adds an attribute so that gcc
will report its use as deprecated, to help application migration.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-07-19 18:50:44 +02:00
committed by Carlos R. Mafra
parent 89295b91fb
commit 9740c02403

View File

@@ -52,6 +52,22 @@
#endif
/*
* Define some macro to provide attributes for the compiler
*
* These attributes help producing better code and/or detecting bugs, however not all compiler support them
* as they are not standard.
* Because we're a public API header, we can't count on autoconf to detect them for us, so we use that #if
* mechanism and define an internal macro appropriately. Please note that the macro are not considered being
* part of the public API.
*/
#if __GNUC__ >= 3
#define __wrlib_deprecated(msg) __attribute__ ((deprecated(msg)))
#else
#define __wrlib_deprecated(msg)
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -160,6 +176,9 @@ typedef struct RContext {
struct {
unsigned int use_shared_pixmap:1;
unsigned int optimize_for_speed:1
__wrlib_deprecated("Flag optimize_for_speed in RContext is not used anymore "
"and will be removed in future version, please do not use");
} flags;
} RContext;
@@ -481,4 +500,10 @@ extern int RErrorCode;
}
#endif /* __cplusplus */
/*
* The definitions below are done for internal use only
* We undef them so users of the library may not misuse them
*/
#undef __wrlib_deprecated
#endif