mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
LibC: Move struct timeval to sys/time.h. #POSIX
This commit is contained in:
parent
16ea34fc12
commit
cbd858544d
Notes:
sideshowbarker
2024-07-19 13:52:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/cbd858544db
10 changed files with 42 additions and 34 deletions
|
@ -2,7 +2,8 @@
|
|||
|
||||
namespace AK {
|
||||
|
||||
inline void timeval_sub(const struct timeval* a, const struct timeval* b, struct timeval* result)
|
||||
template<typename TimevalType>
|
||||
inline void timeval_sub(const TimevalType* a, const TimevalType* b, TimevalType* result)
|
||||
{
|
||||
result->tv_sec = a->tv_sec - b->tv_sec;
|
||||
result->tv_usec = a->tv_usec - b->tv_usec;
|
||||
|
@ -12,7 +13,8 @@ inline void timeval_sub(const struct timeval* a, const struct timeval* b, struct
|
|||
}
|
||||
}
|
||||
|
||||
inline void timeval_add(const struct timeval* a, const struct timeval* b, struct timeval* result)
|
||||
template<typename TimevalType>
|
||||
inline void timeval_add(const TimevalType* a, const TimevalType* b, TimevalType* result)
|
||||
{
|
||||
result->tv_sec = a->tv_sec + b->tv_sec;
|
||||
result->tv_usec = a->tv_usec + b->tv_usec;
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
struct timeval {
|
||||
time_t tv_sec;
|
||||
suseconds_t tv_usec;
|
||||
};
|
||||
|
||||
struct timezone {
|
||||
int tz_minuteswest;
|
||||
int tz_dsttime;
|
||||
|
|
|
@ -37,11 +37,6 @@ typedef uint32_t clock_t;
|
|||
#define __socklen_t uint32_t
|
||||
typedef __socklen_t socklen_t;
|
||||
|
||||
struct timeval {
|
||||
time_t tv_sec;
|
||||
suseconds_t tv_usec;
|
||||
};
|
||||
|
||||
struct stat {
|
||||
dev_t st_dev; /* ID of device containing file */
|
||||
ino_t st_ino; /* inode number */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
class CElapsedTimer {
|
||||
public:
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibCore/CLock.h>
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/CLock.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
class CEvent;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include <LibCore/CIODevice.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/select.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <AK/printf.cpp>
|
||||
|
||||
CIODevice::CIODevice(CObject* parent)
|
||||
|
|
|
@ -35,6 +35,7 @@ function run_fetch_git() {
|
|||
if [ -d "$PORT_DIR/.git" ]; then
|
||||
run_command git fetch
|
||||
run_command git reset --hard FETCH_HEAD
|
||||
run_command git clean -fx
|
||||
else
|
||||
run_command_nocd git clone "$1" "$PORT_DIR"
|
||||
fi
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#include "DNSPacket.h"
|
||||
#include "DNSRecord.h"
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/BufferStream.h>
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <LibCore/CConfigFile.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <unistd.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/BufferStream.h>
|
||||
#include "DNSPacket.h"
|
||||
#include "DNSRecord.h"
|
||||
#include <LibCore/CConfigFile.h>
|
||||
|
||||
#define T_A 1
|
||||
#define T_NS 2
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue