1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

include: We should use __func__ which is C99

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2015-04-02 10:56:31 +02:00
parent 7ec798d3e7
commit a3357b8920
2 changed files with 7 additions and 9 deletions

View File

@@ -139,10 +139,8 @@ int gettimeofday(struct timeval *__p, void *__t);
#define MAX_BUF_SIZE 4096 #define MAX_BUF_SIZE 4096
#endif #endif
#ifndef __FUNCTION__ #ifndef __func__
#if defined(__SUNPRO_C) #define __func__ __FUNCTION__
#define __FUNCTION__ __func__
#endif
#endif #endif
#if defined(HAVE_GCC_THREAD_LOCAL_STORAGE) #if defined(HAVE_GCC_THREAD_LOCAL_STORAGE)
@@ -179,7 +177,7 @@ void ssh_log_function(int verbosity,
const char *function, const char *function,
const char *buffer); const char *buffer);
#define SSH_LOG(priority, ...) \ #define SSH_LOG(priority, ...) \
_ssh_log(priority, __FUNCTION__, __VA_ARGS__) _ssh_log(priority, __func__, __VA_ARGS__)
/* LEGACY */ /* LEGACY */
void ssh_log_common(struct ssh_common_struct *common, void ssh_log_common(struct ssh_common_struct *common,
@@ -197,18 +195,18 @@ struct error_struct {
}; };
#define ssh_set_error(error, code, ...) \ #define ssh_set_error(error, code, ...) \
_ssh_set_error(error, code, __FUNCTION__, __VA_ARGS__) _ssh_set_error(error, code, __func__, __VA_ARGS__)
void _ssh_set_error(void *error, void _ssh_set_error(void *error,
int code, int code,
const char *function, const char *function,
const char *descr, ...) PRINTF_ATTRIBUTE(4, 5); const char *descr, ...) PRINTF_ATTRIBUTE(4, 5);
#define ssh_set_error_oom(error) \ #define ssh_set_error_oom(error) \
_ssh_set_error_oom(error, __FUNCTION__) _ssh_set_error_oom(error, __func__)
void _ssh_set_error_oom(void *error, const char *function); void _ssh_set_error_oom(void *error, const char *function);
#define ssh_set_error_invalid(error) \ #define ssh_set_error_invalid(error) \
_ssh_set_error_invalid(error, __FUNCTION__) _ssh_set_error_invalid(error, __func__)
void _ssh_set_error_invalid(void *error, const char *function); void _ssh_set_error_invalid(void *error, const char *function);

View File

@@ -1548,7 +1548,7 @@ int ssh_userauth_kbdint(ssh_session session, const char *user,
* This should not happen * This should not happen
*/ */
rc = SSH_AUTH_ERROR; rc = SSH_AUTH_ERROR;
ssh_set_error(session,SSH_FATAL,"Invalid state in %s", __FUNCTION__); ssh_set_error(session, SSH_FATAL, "Invalid state in %s", __func__);
} }
return rc; return rc;
} }