Fix compiler errors

This commit is contained in:
2025-10-28 17:33:52 +01:00
parent c5a21608d7
commit fb8ac1d5c9
7 changed files with 22 additions and 5 deletions
+2
View File
@@ -1,4 +1,6 @@
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#else
#include <time.h>
#endif
+1 -4
View File
@@ -8,12 +8,10 @@
#endif
#include "tcp.h"
#include "config.h"
#include "message.h"
#include <TinyDFS.h>
#define MAX_OPERATIONS 128
#define MAX_REQUESTS_PER_QUEUE 128
#define TAG_METADATA_SERVER -2
#define TAG_METADATA_SERVER_TO_CLIENT -3
@@ -88,7 +86,6 @@ struct TinyDFS {
int num_operations;
Operation operations[MAX_OPERATIONS];
};
TinyDFS *tinydfs_init(char *addr, uint16_t port)
+9
View File
@@ -0,0 +1,9 @@
#ifndef CONFIG_INCLUDED
#define CONFIG_INCLUDED
#define MAX_SERVER_ADDRS 4
#define MAX_CHUNK_SERVERS 128
#define MAX_OPERATIONS 128
#define MAX_REQUESTS_PER_QUEUE 128
#endif // CONFIG_INCLUDED
+4
View File
@@ -1,3 +1,5 @@
#ifndef BUILD_LIBRARY
#include <string.h>
#include "chunk_server.h"
@@ -43,3 +45,5 @@ int main(int argc, char **argv)
}
return 0;
}
#endif // BUILD_LIBRARY
+1
View File
@@ -3,6 +3,7 @@
#include "tcp.h"
#include "file_tree.h"
#include "config.h"
#define CONNECTION_TAG_CLIENT -1
#define CONNECTION_TAG_UNKNOWN -2
+4
View File
@@ -4,6 +4,10 @@
#include <stdbool.h>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#define POLL WSAPoll
#define CLOSE_SOCKET closesocket
#else
#include <poll.h>
#include <errno.h>