Add FreeBSD support.

GitOrigin-RevId: 8cc4a42d4c7879ba1b19591f7b37880d5d554585
This commit is contained in:
levlam 2018-11-02 22:47:20 +03:00
parent 37738ec61a
commit 0624f75eec
4 changed files with 8 additions and 1 deletions

View File

@ -19,7 +19,7 @@ TDLib (Telegram Database library) is a cross-platform library for building [Tele
`TDLib` has many advantages. Notably `TDLib` is:
* **Cross-platform**: `TDLib` can be used on Android, iOS, Windows, macOS, Linux, Windows Phone, WebAssembly, watchOS, tvOS, Tizen, Cygwin. It should also work on other *nix systems with or without minimal effort.
* **Cross-platform**: `TDLib` can be used on Android, iOS, Windows, macOS, Linux, FreeBSD, Windows Phone, WebAssembly, watchOS, tvOS, Tizen, Cygwin. It should also work on other *nix systems with or without minimal effort.
* **Multilanguage**: `TDLib` can be easily used with any programming language that is able to execute C functions. Additionally it already has native Java (using `JNI`) bindings and .NET (using `C++/CLI` and `C++/CX`) bindings.
* **Easy to use**: `TDLib` takes care of all network implementation details, encryption and local data storage.
* **High-performance**: in the [Telegram Bot API](https://core.telegram.org/bots/api), each `TDLib` instance handles more than 23000 active bots simultaneously.

View File

@ -19,6 +19,9 @@
#if TD_LINUX || TD_ANDROID || TD_TIZEN
#define TD_POLL_EPOLL 1
#define TD_EVENTFD_LINUX 1
#elif TD_FREEBSD
#define TD_POLL_KQUEUE 1
#define TD_EVENTFD_BSD 1
#elif TD_CYGWIN
#define TD_POLL_SELECT 1
#define TD_EVENTFD_BSD 1

View File

@ -18,6 +18,8 @@
#include <cstdint>
#include <sys/types.h> // must be included before sys/event.h, which depends on sys/types.h on FreeBSD
#include <sys/event.h>
namespace td {

View File

@ -43,6 +43,8 @@
#define TD_TIZEN 1
#elif defined(__linux__)
#define TD_LINUX 1
#elif defined(__FreeBSD__)
#define TD_FREEBSD 1
#elif defined(__CYGWIN__)
#define TD_CYGWIN 1
#elif defined(__EMSCRIPTEN__)