mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-31 00:03:07 +03:00
cmake: Check for weak attribute
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@ -375,6 +375,23 @@ int main(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}" HAVE_FALLTHROUGH_ATTRIBUTE)
|
}" HAVE_FALLTHROUGH_ATTRIBUTE)
|
||||||
|
|
||||||
|
check_c_source_compiles("
|
||||||
|
#define WEAK __attribute__((weak))
|
||||||
|
|
||||||
|
WEAK int sum(int a, int b)
|
||||||
|
{
|
||||||
|
return a + b;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
int i = sum(2, 2);
|
||||||
|
|
||||||
|
(void)i;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}" HAVE_WEAK_ATTRIBUTE)
|
||||||
|
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#define __unused __attribute__((unused))
|
#define __unused __attribute__((unused))
|
||||||
|
@ -225,6 +225,7 @@
|
|||||||
|
|
||||||
#cmakedefine HAVE_FALLTHROUGH_ATTRIBUTE 1
|
#cmakedefine HAVE_FALLTHROUGH_ATTRIBUTE 1
|
||||||
#cmakedefine HAVE_UNUSED_ATTRIBUTE 1
|
#cmakedefine HAVE_UNUSED_ATTRIBUTE 1
|
||||||
|
#cmakedefine HAVE_WEAK_ATTRIBUTE 1
|
||||||
|
|
||||||
#cmakedefine HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
#cmakedefine HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
||||||
#cmakedefine HAVE_DESTRUCTOR_ATTRIBUTE 1
|
#cmakedefine HAVE_DESTRUCTOR_ATTRIBUTE 1
|
||||||
|
Reference in New Issue
Block a user