[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 19/36: Simplified usage of the function name magic macro
From: |
gnunet |
Subject: |
[libmicrohttpd] 19/36: Simplified usage of the function name magic macros |
Date: |
Thu, 01 Jun 2023 12:30:24 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 4973c6cff0166f66a57667d29ec5a12580ef9ba5
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri May 19 14:26:43 2023 +0300
Simplified usage of the function name magic macros
---
src/include/mhd_options.h | 15 +++++++++++++++
src/microhttpd/connection.c | 8 ++++----
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/src/include/mhd_options.h b/src/include/mhd_options.h
index 5a5b7fee..821407a9 100644
--- a/src/include/mhd_options.h
+++ b/src/include/mhd_options.h
@@ -172,4 +172,19 @@
#endif /* ! (MHD_ASAN_ACTIVE && HAVE_SANITIZER_ASAN_INTERFACE_H &&
(FUNC_ATTR_PTRCOMPARE_WORKS || FUNC_ATTR_NOSANITIZE_WORKS)) */
+
+/**
+ * Automatic string with the name of the current function
+ */
+#if defined(HAVE___FUNC__)
+#define MHD_FUNC_ __func__
+#elif defined(HAVE___FUNCTION__)
+#define MHD_FUNC_ __FUNCTION__
+#elif defined(HAVE___PRETTY_FUNCTION__)
+#define MHD_FUNC_ __PRETTY_FUNCTION__
+#else
+#define MHD_FUNC_ "**name unavailable**"
+#endif
+
+
#endif /* MHD_OPTIONS_H */
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 7f07a867..859ca820 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2564,7 +2564,7 @@ MHD_connection_update_event_loop_info (struct
MHD_Connection *connection)
#if DEBUG_STATES
MHD_DLOG (connection->daemon,
_ ("In function %s handling connection at state: %s\n"),
- __FUNCTION__,
+ MHD_FUNC_,
MHD_state_to_string (connection->state));
#endif
switch (connection->state)
@@ -4198,7 +4198,7 @@ MHD_connection_handle_read (struct MHD_Connection
*connection,
#if DEBUG_STATES
MHD_DLOG (connection->daemon,
_ ("In function %s handling connection at state: %s\n"),
- __FUNCTION__,
+ MHD_FUNC_,
MHD_state_to_string (connection->state));
#endif
/* TODO: check whether the next 'switch()' really needed */
@@ -4292,7 +4292,7 @@ MHD_connection_handle_write (struct MHD_Connection
*connection)
#if DEBUG_STATES
MHD_DLOG (connection->daemon,
_ ("In function %s handling connection at state: %s\n"),
- __FUNCTION__,
+ MHD_FUNC_,
MHD_state_to_string (connection->state));
#endif
switch (connection->state)
@@ -4849,7 +4849,7 @@ MHD_connection_handle_idle (struct MHD_Connection
*connection)
#if DEBUG_STATES
MHD_DLOG (daemon,
_ ("In function %s handling connection at state: %s\n"),
- __FUNCTION__,
+ MHD_FUNC_,
MHD_state_to_string (connection->state));
#endif
switch (connection->state)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 24/36: websocket_threaded_example: fixed wrong commented-out code, (continued)
- [libmicrohttpd] 24/36: websocket_threaded_example: fixed wrong commented-out code, gnunet, 2023/06/01
- [libmicrohttpd] 22/36: test_client_put_stop: muted compiler warnings, gnunet, 2023/06/01
- [libmicrohttpd] 14/36: Added specific headers inclusion and detection, gnunet, 2023/06/01
- [libmicrohttpd] 07/36: configure: renamed macro, gnunet, 2023/06/01
- [libmicrohttpd] 11/36: test_client_put_stop: fixed typo in comment, gnunet, 2023/06/01
- [libmicrohttpd] 17/36: examples/sessions.c: removed non-portable function and improved safety, gnunet, 2023/06/01
- [libmicrohttpd] 18/36: configure: fixed detection of __FUNCTION__ magic macro, gnunet, 2023/06/01
- [libmicrohttpd] 06/36: test_toolarge: fixed reported error description, gnunet, 2023/06/01
- [libmicrohttpd] 13/36: test_timeout: moved to heavy tests, gnunet, 2023/06/01
- [libmicrohttpd] 16/36: test_post: fixed caseless key name match, gnunet, 2023/06/01
- [libmicrohttpd] 19/36: Simplified usage of the function name magic macros,
gnunet <=
- [libmicrohttpd] 23/36: .gitignore: force include all *.{c,h} files, gnunet, 2023/06/01
- [libmicrohttpd] 26/36: test_client_put_stop: fixed typo in diag message, gnunet, 2023/06/01
- [libmicrohttpd] 25/36: Detect sysctl() symbols in configure, gnunet, 2023/06/01
- [libmicrohttpd] 28/36: contrib/make-dist.sh: added use of zopfli if available, gnunet, 2023/06/01
- [libmicrohttpd] 29/36: daemon.c: redesigned code for clarity and formatting, gnunet, 2023/06/01
- [libmicrohttpd] 35/36: autoinit_funcs.h: fixed warning on MSVC, gnunet, 2023/06/01
- [libmicrohttpd] 27/36: Added support for custom command for tarball compression, gnunet, 2023/06/01
- [libmicrohttpd] 15/36: examples/largepost.c: fixed caseless method match, gnunet, 2023/06/01
- [libmicrohttpd] 20/36: tests: unified use of function name macros, gnunet, 2023/06/01
- [libmicrohttpd] 21/36: Added internal preprocessor macro for magic macro presence, gnunet, 2023/06/01