Compare commits

...

2 commits

Author SHA1 Message Date
stasoid
39ae39d5db
Merge b98b2a463a into 63a5717bc7 2024-11-20 16:09:04 -05:00
stasoid
b98b2a463a AK: Don't include winsock2.h in Time.h
This is done for two reasons:
1. winsock2.h includes windows.h, which is big and slows compilation
2. windows.h defines `interface` as `struct`, which leads to error in
   HTMLOptionElement.h: invalid parameter name: 'struct' is a keyword
   (expanded from macro WEB_PLATFORM_OBJECT)
2024-11-18 14:29:09 +05:00
2 changed files with 9 additions and 7 deletions

View file

@ -7,11 +7,10 @@
#include <AK/Checked.h>
#include <AK/Time.h>
#include <time.h>
#if defined(AK_OS_WINDOWS)
# include <profileapi.h>
#else
# include <sys/time.h>
#ifdef AK_OS_WINDOWS
# define timeval dummy_timeval
# include <windows.h>
# undef timeval
#endif
namespace AK {

View file

@ -12,8 +12,11 @@
#include <AK/Checked.h>
#include <AK/Platform.h>
#include <AK/Types.h>
#if defined(AK_OS_WINDOWS)
# include <winsock2.h>
#ifdef AK_OS_WINDOWS
struct timeval {
long tv_sec;
long tv_usec;
};
#else
# include <sys/time.h>
#endif