From 3467b309f4ef0f2c288f0c07fa28627492be0e49 Mon Sep 17 00:00:00 2001 From: Garo Bournoutian Date: Wed, 17 Jan 2024 13:23:29 -0800 Subject: [PATCH] Remove usages of no-op POEMs (libevent) (#2220) - stdio_poem, string_poem, strings_poem, wchar_poem b/307941391 --- third_party/libevent/epoll.c | 7 ++----- third_party/libevent/event.c | 6 +----- third_party/libevent/evutil.c | 10 +++++----- third_party/libevent/kqueue.c | 13 +++++-------- third_party/libevent/log.c | 6 +----- third_party/libevent/poll.c | 11 +++-------- 6 files changed, 17 insertions(+), 36 deletions(-) diff --git a/third_party/libevent/epoll.c b/third_party/libevent/epoll.c index 94dcc9bb3f8d..e222e3ec21ed 100644 --- a/third_party/libevent/epoll.c +++ b/third_party/libevent/epoll.c @@ -39,10 +39,6 @@ // Use libevent's local compatibility versions of these. #include "third_party/libevent/compat/sys/queue.h" -// Include Starboard poems after all system headers. -#include "starboard/client_porting/poem/stdio_poem.h" -#include "starboard/client_porting/poem/string_poem.h" - #include "starboard/system.h" #define LibErr SbSystemGetLastError() #else // STARBOARD @@ -57,17 +53,18 @@ #include #include #include +#endif // STARBOARD #include #include #include #include +#ifndef STARBOARD #include #ifdef HAVE_FCNTL_H #include #endif #define LibErr errno #endif // STARBOARD - #include "event.h" #include "event-internal.h" #ifndef STARBOARD diff --git a/third_party/libevent/event.c b/third_party/libevent/event.c index d411433c217e..b151ebca969a 100644 --- a/third_party/libevent/event.c +++ b/third_party/libevent/event.c @@ -36,10 +36,6 @@ #endif // defined LIBEVENT_PLATFORM_HEADER #include "compat/sys/queue.h" - -// Include Starboard poems after all system headers. -#include "starboard/client_porting/poem/assert_poem.h" -#include "starboard/client_porting/poem/stdio_poem.h" #else // STARBOARD #ifdef WIN32 #define WIN32_LEAN_AND_MEAN @@ -53,6 +49,7 @@ #include #endif #include +#endif // STARBOARD #include #include #ifndef WIN32 @@ -65,7 +62,6 @@ #include #include #include -#endif // STARBOARD #include "event.h" #include "event-internal.h" diff --git a/third_party/libevent/evutil.c b/third_party/libevent/evutil.c index a5633c8afd21..c4770585b310 100644 --- a/third_party/libevent/evutil.c +++ b/third_party/libevent/evutil.c @@ -36,10 +36,7 @@ #endif // defined LIBEVENT_PLATFORM_HEADER #include "compat/sys/queue.h" - -// Include Starboard poems after all system headers. -#include "starboard/client_porting/poem/stdio_poem.h" -#else +#else // STARBOARD #ifdef WIN32 #include #define WIN32_LEAN_AND_MEAN @@ -57,19 +54,22 @@ #ifdef HAVE_FCNTL_H #include #endif +#endif // STARBOARD #ifdef HAVE_STDLIB_H #include #endif #include +#ifndef STARBOARD #if defined WIN32 && !defined(HAVE_GETTIMEOFDAY_H) #include #endif +#endif #include +#ifndef STARBOARD #include #include #endif - #include "event.h" #include "event-internal.h" #include "evutil.h" diff --git a/third_party/libevent/kqueue.c b/third_party/libevent/kqueue.c index e30ba4111733..fa99e4a364bd 100644 --- a/third_party/libevent/kqueue.c +++ b/third_party/libevent/kqueue.c @@ -33,30 +33,28 @@ #ifdef STARBOARD #include "libevent-starboard.h" -#include -#include -#include #include // Use libevent's local compatibility versions of these. #include "third_party/libevent/compat/sys/queue.h" #include "third_party/libevent/compat/sys/_libevent_time.h" - -// Include Starboard poems after all system headers. -#include "starboard/client_porting/poem/stdio_poem.h" -#include "starboard/client_porting/poem/string_poem.h" #else // STARBOARD #define _GNU_SOURCE 1 +#endif // STARBOARD #include +#ifndef STARBOARD #ifdef HAVE_SYS_TIME_H #include #else #include #endif #include +#endif // STARBOARD #include +#ifndef STARBOARD #include +#endif // STARBOARD #include #include #include @@ -66,7 +64,6 @@ #ifdef HAVE_INTTYPES_H #include #endif -#endif // STARBOARD /* Some platforms apparently define the udata field of struct kevent as * intptr_t, whereas others define it as void*. There doesn't seem to be an diff --git a/third_party/libevent/log.c b/third_party/libevent/log.c index b4b9d43c6eda..c701549d25aa 100644 --- a/third_party/libevent/log.c +++ b/third_party/libevent/log.c @@ -51,9 +51,6 @@ #include "starboard/common/log.h" #include "starboard/system.h" #include "starboard/types.h" - -// Include Starboard poems after all system headers. -#include "starboard/client_porting/poem/string_poem.h" #else // STARBOARD #ifdef WIN32 #define WIN32_LEAN_AND_MEAN @@ -61,6 +58,7 @@ #undef WIN32_LEAN_AND_MEAN #endif #include +#endif // STARBOARD #ifdef HAVE_SYS_TIME_H #include #else @@ -71,8 +69,6 @@ #include #include #include -#endif // STARBOARD - #include "event.h" #include "log.h" diff --git a/third_party/libevent/poll.c b/third_party/libevent/poll.c index 52b65336eade..b11f0191c4a7 100644 --- a/third_party/libevent/poll.c +++ b/third_party/libevent/poll.c @@ -37,16 +37,9 @@ #include "libevent-starboard.h" #endif // defined LIBEVENT_PLATFORM_HEADER -#include -#include - // Use libevent's local compatibility versions of these. #include "third_party/libevent/compat/sys/queue.h" #include "third_party/libevent/compat/sys/_libevent_time.h" - -// Include Starboard poems after all system headers. -#include "starboard/client_porting/poem/stdio_poem.h" -#include "starboard/client_porting/poem/string_poem.h" #else // STARBOARD #include #ifdef HAVE_SYS_TIME_H @@ -55,8 +48,11 @@ #include #endif #include +#endif // STARBOARD #include +#ifndef STARBOARD #include +#endif // STARBOARD #include #include #include @@ -65,7 +61,6 @@ #ifdef CHECK_INVARIANTS #include #endif -#endif // STARBOARD #include "event.h" #include "event-internal.h"