mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 16:34:18 +09:00
[winpr,platform] fix WINPR_ATTR_MALLOC for older GCC
This commit is contained in:
@@ -626,7 +626,11 @@ WINPR_PRAGMA_DIAG_POP
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
__attribute__((malloc, warn_unused_result)) /** @since version 3.3.0 */
|
||||
#endif
|
||||
#elif defined(__GNUC__) && (__GNUC__ > 10)
|
||||
#elif defined(__GNUC__)
|
||||
#if (__GNUC__ <= 10)
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
__attribute__((malloc, warn_unused_result)) /** @since version 3.3.0 */
|
||||
#else
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
[[gnu::malloc(deallocator, ptrindex), nodiscard]] /** @since version 3.3.0 */
|
||||
@@ -637,6 +641,7 @@ WINPR_PRAGMA_DIAG_POP
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) \
|
||||
__attribute__((malloc(deallocator, ptrindex), warn_unused_result)) /** @since version 3.3.0 */
|
||||
#endif
|
||||
#endif
|
||||
#elif defined(_MSC_VER)
|
||||
#define WINPR_ATTR_MALLOC(deallocator, ptrindex) __declspec(restrict) /** @since version 3.3.0 */
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user