summaryrefslogtreecommitdiff
path: root/event-config.h.cmake
diff options
context:
space:
mode:
authorAzat Khuzhin <a3at.mail@gmail.com>2018-06-19 10:15:08 +0300
committerAzat Khuzhin <a3at.mail@gmail.com>2018-08-02 02:50:48 +0300
commite85818d24850540d220e6d7bc0a30653ba2135f2 (patch)
tree9030dff44f70971a5e1f24098c927621d61ddb2f /event-config.h.cmake
parentc3a6fe75e1511a4c7a7a6ef0a5954b1918902933 (diff)
downloadlibevent-e85818d24850540d220e6d7bc0a30653ba2135f2.tar.gz
Cleanup __func__ detection
First of all __func__ is not a macro, it is char[] array, so the code that we had before in cmake, was incorrect, i.e.: #if defined (__func__) #define EVENT____func__ __func__ #elif defined(__FUNCTION__) #define EVENT____func__ __FUNCTION__ #else #define EVENT____func__ __FILE__ #endif So just detect do we have __func__/__FUNCTION__ in configure/cmake before build and define EVENT__HAVE___func__/EVENT__HAVE___FUNCTION__ to use the later to choose which should be used as a __func__ (if it is not presented). Closes: #644
Diffstat (limited to 'event-config.h.cmake')
-rw-r--r--event-config.h.cmake13
1 files changed, 3 insertions, 10 deletions
diff --git a/event-config.h.cmake b/event-config.h.cmake
index 6cfbb953..3f8a9b59 100644
--- a/event-config.h.cmake
+++ b/event-config.h.cmake
@@ -470,16 +470,6 @@
/* The size of 'void *', as computer by sizeof */
#define EVENT__SIZEOF_VOID_P @EVENT__SIZEOF_VOID_P@
-/* set an alias for whatever __func__ __FUNCTION__ is, what sillyness */
-#if defined (__func__)
-#define EVENT____func__ __func__
-#elif defined(__FUNCTION__)
-#define EVENT____func__ __FUNCTION__
-#else
-#define EVENT____func__ __FILE__
-#endif
-
-
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
@@ -496,6 +486,9 @@
#define EVENT__inline @EVENT__inline@
#endif
+#cmakedefine EVENT__HAVE___func__ 1
+#cmakedefine EVENT__HAVE___FUNCTION__ 1
+
/* Define to `unsigned' if <sys/types.h> does not define. */
#define EVENT__size_t @EVENT__size_t@