]> granicus.if.org Git - libevent/commitdiff
util-internal: fix __func__ redefinition (netbsd)
authorAzat Khuzhin <a3at.mail@gmail.com>
Tue, 6 Dec 2016 09:08:32 +0000 (12:08 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Tue, 6 Dec 2016 09:54:33 +0000 (12:54 +0300)
==> netbsd: In file included from ../listener.c:57:0:
==> netbsd: ../util-internal.h:58:0: warning: "__func__" redefined [enabled by default]
==> netbsd:  #define __func__ EVENT____func__
==> netbsd:  ^
==> netbsd: In file included from /usr/include/amd64/types.h:39:0,
==> netbsd:                  from /usr/include/sys/types.h:45,
==> netbsd:                  from ../listener.c:30:
==> netbsd: /usr/include/sys/cdefs.h:394:0: note: this is the location of the previous definition
==> netbsd:  #define __func__ __PRETTY_FUNCTION__

event_rpcgen.py
sample/signal-test.c
test/regress_main.c
test/test-closed.c
test/test-eof.c
test/test-weof.c
util-internal.h

index c5375656969e38f2fab5e884bc4e85132c6dafc6..9baf73026a008e3620d01305142b96321d6dcff1 100755 (executable)
@@ -1585,7 +1585,7 @@ class CCodeGenerator:
                  '#include <event2/event.h>\n'
                  '#include <event2/buffer.h>\n'
                  '#include <event2/tag.h>\n\n'
-                 '#ifdef EVENT____func__\n'
+                 '#if defined(EVENT____func__) && !defined(__func__)\n'
                  '#define __func__ EVENT____func__\n'
                  '#endif\n\n'
                  )
index 6249f8790625e052f6cbc02422bc71c45f503ece..18668350b868c2b8981f5ff00c875e770bcc49db 100644 (file)
 
 #include <event2/event.h>
 
-#ifdef EVENT____func__
-#define __func__ EVENT____func__
-#endif
-
 int called = 0;
 
 static void
@@ -37,7 +33,7 @@ signal_cb(evutil_socket_t fd, short event, void *arg)
 {
        struct event *signal = arg;
 
-       printf("%s: got signal %d\n", __func__, event_get_signal(signal));
+       printf("signal_cb: got signal %d\n", event_get_signal(signal));
 
        if (called >= 2)
                event_del(signal);
index 6d045bb8339f553c208a59ed1b9c74821d13953d..44e291119a3db11e6834dccb930c80869fa83199 100644 (file)
 
 #include "event2/event-config.h"
 
-#ifdef EVENT____func__
-#define __func__ EVENT____func__
-#endif
-
 #if 0
 #include <sys/types.h>
 #include <sys/stat.h>
index 47a56fa823def8b2d6be16204a40feeaf060bdd9..1dd988592d2a86685addc2af1663275349921e72 100644 (file)
 #include <event.h>
 #include <evutil.h>
 
-#ifdef EVENT____func__
-#define __func__ EVENT____func__
-#endif
-
 struct timeval timeout = {3, 0};
 
 static void
index 61169b1441b5d65f7983f7f6bf971330bae8638c..284ead78ae34a899a343000ab88f2fdb541b4d49 100644 (file)
 #include <event.h>
 #include <evutil.h>
 
-#ifdef EVENT____func__
-#define __func__ EVENT____func__
-#endif
-
 int test_okay = 1;
 int called = 0;
 struct timeval timeout = {60, 0};
index c379f287cb503d862e3f8f67103b2508bf163872..52c7afbd65b999c71c7e564e42c9ed7f5175a7c9 100644 (file)
@@ -24,6 +24,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+#include "../util-internal.h"
 #include "event2/event-config.h"
 
 #ifdef _WIN32
 #include "event2/event_compat.h"
 #include "event2/util.h"
 
-#ifdef EVENT____func__
-#define __func__ EVENT____func__
-#endif
-
 evutil_socket_t pair[2];
 int test_okay = 1;
 int called = 0;
index b851e2ae62c01daf1ee44e47216d42794040f4a0..38d0f595fb7583d41e4ec788997e68cf1f35c911 100644 (file)
@@ -54,7 +54,7 @@ extern "C" {
 #ifdef EVENT__inline
 #define inline EVENT__inline
 #endif
-#ifdef EVENT____func__
+#if defined(EVENT____func__) && !defined(__func__)
 #define __func__ EVENT____func__
 #endif