Detect if __func__ can be used with debugging

This commit is contained in:
Willem Toorop 2020-02-20 21:09:17 +01:00
parent 4453febf2d
commit dadddb0d7b
3 changed files with 11 additions and 0 deletions

View File

@ -481,6 +481,11 @@ if (HAVE_STRPTIME)
check_c_source_runs("${STRPTIME_TEST_SOURCE}" STRPTIME_WORKS)
endif ()
try_compile(HAVE___FUNC__
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/cmake/tests/test___func__.c
)
# TCP Fast Open.
if (NOT ENABLE_TCP_FAST_OPEN)
message(WARNING "TCP Fast Open disabled.")

View File

@ -213,6 +213,8 @@
#cmakedefine HAVE_TARGET_ENDIANNESS
#cmakedefine TARGET_IS_BIG_ENDIAN
#cmakedefine HAVE___FUNC__ 1
#ifdef HAVE___FUNC__
#define __FUNC__ __func__
#else

View File

@ -0,0 +1,4 @@
int main (int ac, char *av[])
{
char *s = __func__;
}