Skip to content

Commit

Permalink
Remove usages of no-op POEMs (libevent)
Browse files Browse the repository at this point in the history
- stdio_poem, string_poem, strings_poem, wchar_poem

b/307941391
  • Loading branch information
gbournou committed Jan 17, 2024
1 parent 0db94d7 commit 54ef56e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 42 deletions.
7 changes: 2 additions & 5 deletions third_party/libevent/epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -57,17 +53,18 @@
#include <sys/queue.h>
#include <sys/epoll.h>
#include <signal.h>
#endif // STARBOARD
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifndef STARBOARD
#include <errno.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#define LibErr errno
#endif // STARBOARD

#include "event.h"
#include "event-internal.h"
#ifndef STARBOARD
Expand Down
9 changes: 2 additions & 7 deletions third_party/libevent/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,10 +45,11 @@
#include <sys/types.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#else
#include <sys/_libevent_time.h>
#endif
#include <sys/queue.h>
#endif // STARBOARD
#include <stdio.h>
#include <stdlib.h>
#ifndef WIN32
Expand All @@ -65,8 +62,6 @@
#include <string.h>
#include <assert.h>
#include <time.h>
#endif // STARBOARD

#include "event.h"
#include "event-internal.h"
#include "evutil.h"
Expand Down
10 changes: 3 additions & 7 deletions third_party/libevent/evutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <winsock2.h>
#define WIN32_LEAN_AND_MEAN
Expand All @@ -64,12 +61,11 @@
#if defined WIN32 && !defined(HAVE_GETTIMEOFDAY_H)
#include <sys/timeb.h>
#endif
#include <stdio.h>
#include <signal.h>

#include <sys/queue.h>
#endif

#endif // STARBOARD
#include <stdio.h>
#include "event.h"
#include "event-internal.h"
#include "evutil.h"
Expand Down
14 changes: 5 additions & 9 deletions third_party/libevent/kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,27 @@
#ifdef STARBOARD
#include "libevent-starboard.h"

#include <assert.h>
#include <sys/types.h>
#include <sys/event.h>
#include <sys/socket.h>

// 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 <sys/types.h>
#ifndef STARBOARD
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_libevent_time.h>
#endif
#include <sys/queue.h>
#endif // STARBOARD
#include <sys/event.h>
#ifndef STARBOARD
#include <signal.h>
#endif // STARBOARD
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -66,7 +63,6 @@
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#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
Expand Down
6 changes: 1 addition & 5 deletions third_party/libevent/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,14 @@
#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
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#endif
#include <sys/types.h>
#endif // STARBOARD
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#else
Expand All @@ -71,8 +69,6 @@
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#endif // STARBOARD

#include "event.h"

#include "log.h"
Expand Down
12 changes: 3 additions & 9 deletions third_party/libevent/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,9 @@
#include "libevent-starboard.h"
#endif // defined LIBEVENT_PLATFORM_HEADER

#include <poll.h>
#include <stdlib.h>

// 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 <sys/types.h>
#ifdef HAVE_SYS_TIME_H
Expand All @@ -55,8 +48,11 @@
#include <sys/_libevent_time.h>
#endif
#include <sys/queue.h>
#endif // STARBOARD
#include <poll.h>
#ifndef STARBOARD
#include <signal.h>
#endif // STARBOARD
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -65,8 +61,6 @@
#ifdef CHECK_INVARIANTS
#include <assert.h>
#endif
#endif // STARBOARD

#include "event.h"
#include "event-internal.h"
#ifndef STARBOARD
Expand Down

0 comments on commit 54ef56e

Please sign in to comment.