]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Port to OpenBSD
authorElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 29 Oct 2021 18:06:00 +0000 (20:06 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 29 Oct 2021 18:06:00 +0000 (20:06 +0200)
src/CMakeLists.txt
src/client/client_commands.c
src/util.c

index 8098a781c02c6cea390f9a23cf8df74c68de13e2..2cc9ad44c0917917364c1bcbff96d7d045093487 100644 (file)
@@ -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
index cf13c0fde9b261154113fafa6929d5a59e88432a..a93f38b34ea7dcb74aa2962c20fc99b7f081b4d6 100644 (file)
@@ -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;
index 7bdd1de93046bb03b838e26b3eb11df24653417b..187eabd122a1d3b456fd667b882eb8902c992118 100644 (file)
@@ -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