aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/elog.h
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2022-08-07 09:36:01 -0700
committerAndres Freund <andres@anarazel.de>2022-08-07 09:36:01 -0700
commit320f92b744b44f961e5d56f5f21de003e8027a7f (patch)
tree27ddd145bc88ec953aea588acf387dbcdecd408e /src/include/utils/elog.h
parentafe58c8b746cac1e2c3e9f0fc96a0f69a46c84d3 (diff)
downloadpostgresql-320f92b744b44f961e5d56f5f21de003e8027a7f.tar.gz
postgresql-320f92b744b44f961e5d56f5f21de003e8027a7f.zip
Rely on __func__ being supported
Previously we fell back to __FUNCTION__ and then NULL. As __func__ is in C99 that shouldn't be necessary anymore. Solution.pm defined HAVE_FUNCNAME__FUNCTION instead of HAVE_FUNCNAME__FUNC (originating in 4164e6636e2), as at some point in the past MSVC only supported __FUNCTION__. Our minimum version supports __func__. Reviewed-By: Thomas Munro <thomas.munro@gmail.com> Discussion: https://postgr.es/m/20220807012914.ydz73yte6j3coulo@awork3.anarazel.de
Diffstat (limited to 'src/include/utils/elog.h')
-rw-r--r--src/include/utils/elog.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index 68ead8e8736..56398176901 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -140,7 +140,7 @@
if (__builtin_constant_p(elevel) && (elevel) >= ERROR ? \
errstart_cold(elevel, domain) : \
errstart(elevel, domain)) \
- __VA_ARGS__, errfinish(__FILE__, __LINE__, PG_FUNCNAME_MACRO); \
+ __VA_ARGS__, errfinish(__FILE__, __LINE__, __func__); \
if (__builtin_constant_p(elevel) && (elevel) >= ERROR) \
pg_unreachable(); \
} while(0)
@@ -150,7 +150,7 @@
const int elevel_ = (elevel); \
pg_prevent_errno_in_scope(); \
if (errstart(elevel_, domain)) \
- __VA_ARGS__, errfinish(__FILE__, __LINE__, PG_FUNCNAME_MACRO); \
+ __VA_ARGS__, errfinish(__FILE__, __LINE__, __func__); \
if (elevel_ >= ERROR) \
pg_unreachable(); \
} while(0)