1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Make funcfiftlib compilation compatible with modern compilers (#618)

* wip: make funcfiftlib compilation compatible with modern compilers

* wip: add methods needed for another compiler

* fix: tdutils port config if emscripten

* feat: func source and realpath callback

* fix: invalid fift compilation exceptions

---------

Co-authored-by: krigga <krigga7@gmail.com>
This commit is contained in:
Dan Volkov 2023-03-09 18:37:15 +04:00 committed by GitHub
parent 82e231d0a7
commit 4590ed381b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 142 additions and 31 deletions

View file

@ -28,35 +28,33 @@
#define TD_PORT_POSIX 1
#endif
#if TD_LINUX || TD_ANDROID || TD_TIZEN
#if TD_EMSCRIPTEN
#define TD_POLL_POLL 1
#elif TD_LINUX || TD_ANDROID || TD_TIZEN
#define TD_POLL_EPOLL 1
#define TD_EVENTFD_LINUX 1
#elif TD_FREEBSD || TD_OPENBSD || TD_NETBSD
#define TD_POLL_KQUEUE 1
#define TD_EVENTFD_BSD 1
#elif TD_CYGWIN
#define TD_POLL_SELECT 1
#define TD_EVENTFD_BSD 1
#elif TD_EMSCRIPTEN
#define TD_POLL_POLL 1
// #define TD_EVENTFD_UNSUPPORTED 1
#elif TD_DARWIN
#define TD_POLL_KQUEUE 1
#define TD_EVENTFD_BSD 1
#elif TD_WINDOWS
#define TD_POLL_WINEVENT 1
#define TD_EVENTFD_WINDOWS 1
#else
#error "Poll's implementation is not defined"
#endif
#if TD_EMSCRIPTEN
// #define TD_THREAD_UNSUPPORTED 1
#define TD_POLL_EPOLL 1
#define TD_EVENTFD_UNSUPPORTED 0
#define TD_THREAD_PTHREAD 1
#if TD_LINUX || TD_ANDROID || TD_TIZEN
#define TD_EVENTFD_LINUX 1
#elif TD_TIZEN || TD_LINUX || TD_DARWIN
#elif TD_FREEBSD || TD_OPENBSD || TD_NETBSD || TD_CYGWIN || TD_DARWIN
#define TD_EVENTFD_BSD 1
#elif TD_WINDOWS
#define TD_EVENTFD_WINDOWS 1
#else
#error "eventfd's implementation is not defined"
#endif
#if TD_TIZEN || TD_LINUX || TD_DARWIN || TD_EMSCRIPTEN
#define TD_THREAD_PTHREAD 1
#else
#define TD_THREAD_STL 1

View file

@ -20,6 +20,11 @@
// clang-format off
/*** Determine emscripten ***/
#if defined(__EMSCRIPTEN__)
#define TD_EMSCRIPTEN 1
#endif
/*** Platform macros ***/
#if defined(_WIN32) || defined(_WINDOWS) // _WINDOWS is defined by CMake
#if defined(__cplusplus_winrt)
@ -63,10 +68,11 @@
#define TD_NETBSD 1
#elif defined(__CYGWIN__)
#define TD_CYGWIN 1
#elif defined(__EMSCRIPTEN__)
#define TD_EMSCRIPTEN 1
#elif defined(__unix__) // all unices not caught above
#warning "Probably unsupported Unix platform. Feel free to try to compile"
#elif defined(__unix__) // all unices not caught above
// supress if emscripten
#if !TD_EMSCRIPTEN
#warning "Probably unsupported Unix platform. Feel free to try to compile"
#endif
#define TD_CYGWIN 1
#else
#error "Probably unsupported platform. Feel free to remove the error and try to recompile"