1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-10 06:23:01 +03:00

cmake: Detect __func__ and __FUNCTION__ during configure step

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2015-04-02 13:41:02 +02:00
parent 396f5e2110
commit dc30183d8a
4 changed files with 24 additions and 3 deletions

View File

@@ -201,6 +201,20 @@ int main(void)
return 0;
}" HAVE_GCC_VOLATILE_MEMORY_PROTECTION)
check_c_source_compiles("
#include <stdio.h>
int main(void) {
printf(\"%s\", __func__);
return 0;
}" HAVE_COMPILER__FUNC__)
check_c_source_compiles("
#include <stdio.h>
int main(void) {
printf(\"%s\", __FUNCTION__);
return 0;
}" HAVE_COMPILER__FUNCTION__)
if (WITH_DEBUG_CRYPTO)
set(DEBUG_CRYPTO 1)
endif (WITH_DEBUG_CRYPTO)

View File

@@ -139,6 +139,9 @@
#cmakedefine HAVE_GCC_VOLATILE_MEMORY_PROTECTION 1
#cmakedefine HAVE_COMPILER__FUNC__ 1
#cmakedefine HAVE_COMPILER__FUNCTION__ 1
/* Define to 1 if you want to enable GSSAPI */
#cmakedefine WITH_GSSAPI 1

View File

@@ -29,7 +29,7 @@
#define ECDSA_HEADER_END "-----END EC PRIVATE KEY-----"
#define ssh_pki_log(...) \
_ssh_pki_log(__FUNCTION__, __VA_ARGS__)
_ssh_log(SSH_LOG_FUNCTIONS, __func__, __VA_ARGS__)
void _ssh_pki_log(const char *function,
const char *format, ...) PRINTF_ATTRIBUTE(2, 3);

View File

@@ -139,8 +139,12 @@ int gettimeofday(struct timeval *__p, void *__t);
#define MAX_BUF_SIZE 4096
#endif
#ifndef __func__
#ifndef HAVE_COMPILER__FUNC__
# ifdef HAVE_COMPILER__FUNCTION__
# define __func__ __FUNCTION__
# else
# error "Your system must provide a __func__ macro"
# endif
#endif
#if defined(HAVE_GCC_THREAD_LOCAL_STORAGE)