mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[cmake] Define WINPR_DEFINE_ATTR_NODISCARD
* Do not define WINPR_ATTR_NODISCARD if WINPR_DEFINE_ATTR_NODISCARD is not defined. * Define WINPR_DEFINE_ATTR_NODISCARD via CMake to enable this for internal use only
This commit is contained in:
@@ -96,6 +96,9 @@ include(SetFreeRDPCMakeInstallDir)
|
|||||||
include(Doxygen)
|
include(Doxygen)
|
||||||
include(GetSysconfDir)
|
include(GetSysconfDir)
|
||||||
|
|
||||||
|
# FreeRDP internal builds should always check results
|
||||||
|
add_compile_definitions(WINPR_DEFINE_ATTR_NODISCARD)
|
||||||
|
|
||||||
# Soname versioning
|
# Soname versioning
|
||||||
set(BUILD_NUMBER 0)
|
set(BUILD_NUMBER 0)
|
||||||
if($ENV{BUILD_NUMBER})
|
if($ENV{BUILD_NUMBER})
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
#define WINPR_FALLTHROUGH (void)0;
|
#define WINPR_FALLTHROUGH (void)0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(WINPR_DEFINE_ATTR_NODISCARD)
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#define WINPR_ATTR_NODISCARD __attribute__((warn_unused_result))
|
#define WINPR_ATTR_NODISCARD __attribute__((warn_unused_result))
|
||||||
#elif defined(__GNUC__) && (__GNUC__ >= 7)
|
#elif defined(__GNUC__) && (__GNUC__ >= 7)
|
||||||
@@ -82,6 +83,9 @@
|
|||||||
#else
|
#else
|
||||||
#define WINPR_ATTR_NODISCARD
|
#define WINPR_ATTR_NODISCARD
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
#define WINPR_ATTR_NODISCARD
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#define WINPR_PRAGMA_DIAG_PUSH WINPR_DO_PRAGMA(clang diagnostic push)
|
#define WINPR_PRAGMA_DIAG_PUSH WINPR_DO_PRAGMA(clang diagnostic push)
|
||||||
|
|||||||
Reference in New Issue
Block a user