From dc30183d8aa9f06c2dc9375a882d16e87dbd4272 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 2 Apr 2015 13:41:02 +0200 Subject: cmake: Detect __func__ and __FUNCTION__ during configure step Signed-off-by: Andreas Schneider --- include/libssh/pki_priv.h | 2 +- include/libssh/priv.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libssh/pki_priv.h b/include/libssh/pki_priv.h index 0cbe8b72..788ae616 100644 --- a/include/libssh/pki_priv.h +++ b/include/libssh/pki_priv.h @@ -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); diff --git a/include/libssh/priv.h b/include/libssh/priv.h index 1184ab4a..4cbab95e 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -139,8 +139,12 @@ int gettimeofday(struct timeval *__p, void *__t); #define MAX_BUF_SIZE 4096 #endif -#ifndef __func__ -#define __func__ __FUNCTION__ +#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) -- cgit