From d79c217850105d1d026754abdcfe729010270cb3 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 29 Oct 2021 20:06:00 +0200 Subject: [PATCH] Port to OpenBSD --- src/CMakeLists.txt | 7 ++++++- src/client/client_commands.c | 2 +- src/util.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8098a78..2cc9ad4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,11 +29,16 @@ include_directories(BEFORE ${CMAKE_SOURCE_DIR} ) -if ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") +if ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD") link_directories("/usr/local/lib") include_directories("/usr/local/include") endif() +if ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD") + link_directories("/usr/X11R6/lib") + include_directories("/usr/X11R6/include") +endif() + add_compile_options(-Wall -Wextra -Wpedantic -Werror) set(SOURCES_COMMON diff --git a/src/client/client_commands.c b/src/client/client_commands.c index cf13c0f..a93f38b 100644 --- a/src/client/client_commands.c +++ b/src/client/client_commands.c @@ -42,7 +42,7 @@ static bool block_handler(Client *client, bool good) if (! read_v3s32(client->fd, &pos)) return false; - size_t size; + u64 size; if (! read_u64(client->fd, &size)) return false; diff --git a/src/util.c b/src/util.c index 7bdd1de..187eabd 100644 --- a/src/util.c +++ b/src/util.c @@ -98,7 +98,7 @@ bool my_decompress(const char *compressed, size_t compressed_size, void *decompr inflate(&stream, Z_NO_FLUSH); inflateEnd(&stream); - return stream.total_out == expected_decompressed_size; + return (size_t) stream.total_out == expected_decompressed_size; } // return true if a player is close enough to a block to access it -- 2.44.0