Skip to content

Commit

Permalink
Add OpenBSD port.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf3s committed Jun 10, 2024
1 parent 67eea94 commit 9712ce6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
8 changes: 8 additions & 0 deletions cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
include(CheckIncludeFiles)
else()
include(CheckIncludeFile)
endif()
check_include_file("arpa/inet.h" HAVE_ARPA_INET_H)
check_include_file("dlfcn.h" HAVE_DLFCN_H)
check_include_file("fcntl.h" HAVE_FCNTL_H)
check_include_file("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
check_include_file("inttypes.h" HAVE_INTTYPES_H)
check_include_file("netdb.h" HAVE_NETDB_H)
check_include_file("netinet/in.h" HAVE_NETINET_IN_H)
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
check_include_files("sys/types.h;netinet/tcp.h" HAVE_NETINET_TCP_H)
else()
check_include_file("netinet/tcp.h" HAVE_NETINET_TCP_H)
endif()
check_include_file("poll.h" HAVE_POLL_H)
check_include_file("stdint.h" HAVE_STDINT_H)
check_include_file("stdio.h" HAVE_STDIO_H)
Expand Down
4 changes: 0 additions & 4 deletions include/portable-endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@
#define be64toh(x) _byteswap_uint64(x)
#define le64toh(x) (x)

#ifdef _XBOX

#ifndef __BYTE_ORDER
#define __BYTE_ORDER BYTE_ORDER
#endif
Expand All @@ -207,8 +205,6 @@
#define __PDP_ENDIAN PDP_ENDIAN
#endif

#endif

#elif defined(__GNUC__) || defined(__clang__)

#define htobe16(x) __builtin_bswap16(x)
Expand Down
9 changes: 9 additions & 0 deletions lib/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,15 @@ int getlogin_r(char *buf, size_t size);
#endif
#endif /* __ANDROID__ */

#ifdef __OpenBSD__

#undef ENODATA
#ifndef ENODATA
#define ENODATA ENOATTR
#endif

#endif

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 9712ce6

Please sign in to comment.