Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ function(set_target_common_gns_properties TGT)
target_compile_definitions(${TGT} PUBLIC OSX)
elseif(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
target_compile_definitions(${TGT} PUBLIC FREEBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES OpenBSD)
target_compile_definitions(${TGT} PUBLIC OPENBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES Windows)
target_compile_definitions(${TGT} PUBLIC _WINDOWS)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
Expand Down
2 changes: 1 addition & 1 deletion include/steam/steamclientpublic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ enum ESteamIPv6ConnectivityState
// Define compile time assert macros to let us validate the structure sizes.
#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1];

#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
// The 32-bit version of gcc has the alignment requirement for uint64 and double set to
// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned.
// The 64-bit version of gcc has the alignment requirement for these types set to
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ macro(set_clientlib_target_properties GNS_TARGET)
#endif()
elseif(CMAKE_SYSTEM_NAME MATCHES FreeBSD)

elseif(CMAKE_SYSTEM_NAME MATCHES OpenBSD)

elseif(CMAKE_SYSTEM_NAME MATCHES Windows)
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
get_target_property(TARGET_TYPE ${GNS_TARGET} TYPE)
Expand Down
6 changes: 6 additions & 0 deletions src/public/minbase/minbase_identify.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@
#elif defined(__FreeBSD__)
#define IsFreeBSD() true
#define IsPosix() true
#elif defined(__OpenBSD__)
#define IsOpenBSD() true
#define IsPosix() true
#elif defined( _POSIX_VERSION ) || defined( POSIX ) || defined( VALVE_POSIX )
#define IsPosix() true
#else
Expand Down Expand Up @@ -235,6 +238,9 @@
#ifndef IsFreeBSD
#define IsFreeBSD() false
#endif
#ifndef IsOpenBSD
#define IsOpenBSD() false
#endif

// Detect ARM
#ifndef IsARM
Expand Down
2 changes: 1 addition & 1 deletion src/public/minbase/minbase_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ typedef uint32 uint32_t;
// NOTE: int64_t must match the compiler stdint.h definition
// and so may not match the Steam int64. Mixing the two is
// error-prone so always use the Steam non-_t types in Steam code.
#if defined(COMPILER_GCC) && defined(PLATFORM_64BITS) && !defined(__MINGW32__) && !IsOSX() && !(defined(IOS) || defined(TVOS))
#if defined(COMPILER_GCC) && defined(PLATFORM_64BITS) && !defined(__MINGW32__) && !IsOSX() && !IsIOS() && !IsTVOS() && !IsOpenBSD()
#define INT64_DIFFERENT_FROM_INT64_T 1
typedef long int int64_t;
typedef unsigned long int uint64_t;
Expand Down
8 changes: 8 additions & 0 deletions src/public/tier0/platform_sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ typedef char SteamNetworkingErrMsg[ 1024 ];
// Does this work? If somebody who uses FreeBSD
// wants to test, I would appreciate it!
#define PlatformSupportsRecvTOS() false
#elif defined(__OpenBSD__)

// OpenBSD provides kqueue, but we don't support it, so just use old-school poll()
#define USE_POLL

// Does this work? If somebody who uses OpenBSD
// wants to test, I would appreciate it!
#define PlatformSupportsRecvTOS() false
#else
#define USE_EPOLL
#include <sys/epoll.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2454,8 +2454,10 @@ const char *CSteamNetworkingUtils::GetPlatformString()
return "windows";
#elif IsLinux()
return "linux";
#elif defined( FREEBSD ) || defined( __FreeBSD__ )
#elif IsFreeBSD()
return "freebsd";
#elif IsOpenBSD()
return "openbsd";
#else
#error "Unknown platform"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4289,7 +4289,11 @@ bool ResolveHostname( const char* pszHostname, CUtlVector< SteamNetworkingIPAddr

addrinfo hints;
V_memset( &hints, 0, sizeof( hints ) );
#ifdef AI_V4MAPPED
hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;
#else
hints.ai_flags = AI_ADDRCONFIG;
#endif
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = 0;
hints.ai_protocol = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/tier0/dbg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool Plat_IsInDebugSession()
return (nTracePid != 0);
#elif IsPlaystation()
// NDA material
#elif IsNintendoSwitch()
#elif IsNintendoSwitch() || IsOpenBSD()
return false;
#else
#error "HALP"
Expand Down
Loading