=> 2c7472e6e307bd3f03e3f401b3cf8e86cbb3cb62
[1mdiff --git a/CMakeLists.txt b/CMakeLists.txt[m [1mindex c3285f3..0cd2b4d 100644[m [1m--- a/CMakeLists.txt[m [1m+++ b/CMakeLists.txt[m [36m@@ -1,11 +1,12 @@[m cmake_minimum_required (VERSION 3.1)[m [m [31m-project (the_Foundation VERSION 1.0.2 LANGUAGES C)[m [32m+[m[32mproject (the_Foundation VERSION 1.1.0 LANGUAGES C)[m set (CMAKE_PROJECT_DESCRIPTION "Opinionated C11 library for low-level functionality")[m [m include (CheckIncludeFile)[m include (CheckCSourceCompiles)[m include (CheckFunctionExists)[m [32m+[m[32minclude (CheckSymbolExists)[m include (CMakePackageConfigHelpers)[m include (GNUInstallDirs)[m include (TestBigEndian)[m [36m@@ -71,6 +72,7 @@[m [mcheck_include_file (sys/dirent.h iHaveSysDirent)[m [m # C11 threads[m check_include_file (pthread.h iHavePThread)[m [32m+[m[32mcheck_symbol_exists (pthread_cancel pthread.h iHavePThreadCancel)[m #check_include_file (threads.h iHaveC11Threads)[m set (iHaveC11Threads NO) # TODO: Should use either this OR pthread, not both![m if (FREEBSD OR NETBSD)[m [36m@@ -223,6 +225,10 @@[m [mif (APPLE)[m elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")[m set (iPlatformLinux YES)[m set (SOURCES ${SOURCES} src/platform/linux.c)[m [32m+[m[32melseif (ANDROID)[m [32m+[m[32m set (iPlatformLinux YES)[m [32m+[m[32m set (iPlatformAndroid YES)[m [32m+[m[32m set (SOURCES ${SOURCES} src/platform/linux.c)[m elseif (WIN32)[m set (iPlatformWindows YES)[m set (SOURCES ${SOURCES} src/platform/windows.c)[m [36m@@ -304,7 +310,7 @@[m [mif (GIT_FOUND AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git")[m OUTPUT_STRIP_TRAILING_WHITESPACE[m )[m endif ()[m [31m-configure_file (config.h.in config.h)[m [32m+[m[32mconfigure_file (config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)[m [m set (TFDN_LIB the_Foundation)[m if (TFDN_STATIC_LIBRARY)[m [36m@@ -364,7 +370,7 @@[m [mconfigure_file ([m )[m [m # Dependencies.[m [31m-if (NOT iHaveC11Threads)[m [32m+[m[32mif (NOT iHaveC11Threads AND NOT ANDROID)[m # phtread is exposed via header file usage, so it must be linked publicly.[m target_link_libraries (${TFDN_LIB} PUBLIC pthread)[m endif ()[m [1mdiff --git a/Depends.cmake b/Depends.cmake[m [1mindex 482cf54..03c4077 100644[m [1m--- a/Depends.cmake[m [1m+++ b/Depends.cmake[m [36m@@ -1,5 +1,5 @@[m # Dependencies for the_Foundation[m [31m-if (NOT IOS)[m [32m+[m[32mif (NOT IOS AND NOT ANDROID)[m find_package (PkgConfig)[m pkg_check_modules (ZLIB zlib)[m pkg_check_modules (PCRE libpcre) # Regular expressions[m [36m@@ -35,7 +35,7 @@[m [mif (NOT IOS)[m set (UNISTRING_INCLUDE_DIRS ${UNISTRING_DIR}/include)[m set (UNISTRING_LIBRARIES -L${UNISTRING_DIR}/lib unistring)[m endif ()[m [31m-else ()[m [32m+[m[32melseif (IOS)[m if (IOS_DIR STREQUAL "")[m message (FATAL_ERROR "iOS dependencies not found (set IOS_DIR)")[m endif ()[m [36m@@ -60,6 +60,24 @@[m [melse ()[m endif ()[m set (UNISTRING_INCLUDE_DIRS ${IOS_DIR}/include)[m set (UNISTRING_LIBRARIES ${IOS_DIR}/lib/libunistring.a;${IOS_DIR}/lib/libiconv.a)[m [32m+[m[32melseif (ANDROID)[m [32m+[m[32m if (ANDROID_DIR STREQUAL "")[m [32m+[m[32m message (FATAL_ERROR "Android dependencies not found (set ANDROID_DIR)")[m [32m+[m[32m endif ()[m [32m+[m[32m set (ZLIB_FOUND YES)[m [32m+[m[32m set (ZLIB_LIBRARIES z)[m [32m+[m[32m set (PCRE_FOUND YES)[m [32m+[m[32m set (PCRE_INCLUDE_DIRS ${ANDROID_DIR}/libpcre-android/include)[m [32m+[m[32m set (PCRE_LIBRARIES ${ANDROID_DIR}/libpcre-android/lib/libpcre.a)[m [32m+[m[32m if (TFDN_ENABLE_TLSREQUEST)[m [32m+[m[32m set (OPENSSL_FOUND YES)[m [32m+[m[32m set (OPENSSL_INCLUDE_DIRS ${ANDROID_DIR}/openssl-android/include)[m [32m+[m[32m set (OPENSSL_LDFLAGS ${ANDROID_DIR}/openssl-android/lib/libssl.a;${ANDROID_DIR}/openssl-android/lib/libcrypto.a)[m [32m+[m[32m else ()[m [32m+[m[32m set (OPENSSL_FOUND NO)[m [32m+[m[32m endif ()[m [32m+[m[32m set (UNISTRING_INCLUDE_DIRS ${ANDROID_DIR}/libunistring-android/include)[m [32m+[m[32m set (UNISTRING_LIBRARIES ${ANDROID_DIR}/libunistring-android/lib/libunistring.a;${ANDROID_DIR}/libiconv-android/lib/libiconv.so)[m endif ()[m [m if (ZLIB_FOUND)[m [1mdiff --git a/config.h.in b/config.h.in[m [1mindex fe73fc0..9252123 100644[m [1m--- a/config.h.in[m [1m+++ b/config.h.in[m [36m@@ -30,13 +30,14 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.[m #define iFoundationLibraryVersion { ${the_Foundation_VERSION_MAJOR}, ${the_Foundation_VERSION_MINOR}, ${the_Foundation_VERSION_PATCH} }[m #define iFoundationLibraryGitTag "${iFoundationLibraryGitTag}"[m [m [32m+[m[32m#cmakedefine iPlatformAndroid[m #cmakedefine iPlatformApple[m #cmakedefine iPlatformCygwin[m [32m+[m[32m#cmakedefine iPlatformHaiku[m #cmakedefine iPlatformLinux[m [31m-#cmakedefine iPlatformWindows[m #cmakedefine iPlatformMsys[m [31m-#cmakedefine iPlatformHaiku[m #cmakedefine iPlatformOther[m [32m+[m[32m#cmakedefine iPlatformWindows[m [m #cmakedefine iHaveDebugOutput[m #cmakedefine iHaveBigEndian[m [36m@@ -48,6 +49,7 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.[m #cmakedefine iHaveOpenSSL[m #cmakedefine iHavePcre[m #cmakedefine iHavePThread[m [32m+[m[32m#cmakedefine iHavePThreadCancel[m #cmakedefine iHavePThreadTimedMutex[m #cmakedefine iHaveRegExp[m #cmakedefine iHaveStrnstr[m [1mdiff --git a/src/fileinfo.c b/src/fileinfo.c[m [1mindex d97f459..dc398fb 100644[m [1m--- a/src/fileinfo.c[m [1m+++ b/src/fileinfo.c[m [36m@@ -60,6 +60,8 @@[m [mstatic int access(const char *path, int mode) {[m # include[m # if defined (iHaveSysDirent)[m # include [m [32m+[m[32m# elif defined (iPlatformAndroid)[m [32m+[m[32m# include [m # elif !defined (iPlatformHaiku)[m # include [m # endif[m [1mdiff --git a/src/platform/posix/address.c b/src/platform/posix/address.c[m [1mindex 407439f..cde94bd 100644[m [1m--- a/src/platform/posix/address.c[m [1m+++ b/src/platform/posix/address.c[m [36m@@ -58,7 +58,7 @@[m [mstruct Impl_Address {[m [m iDefineAudienceGetter(Address, lookupFinished)[m [m [31m-#if defined (iPlatformHaiku) || defined (iPlatformOther)[m [32m+[m[32m#if defined (iPlatformHaiku) || defined (iPlatformAndroid) || defined (iPlatformOther)[m # if defined (AI_V4MAPPED_CFG)[m # undef AI_V4MAPPED_CFG[m # endif[m [36m@@ -391,6 +391,7 @@[m [miString *toStringFlags_Address(const iAddress *d, int flags, int family) {[m [m iObjectList *networkInterfaces_Address(void) {[m iObjectList *list = new_ObjectList();[m [32m+[m[32m#if !defined (iPlatformAndroid) /* not supported; see https://github.com/oliviertilmans/android-ifaddrs */[m struct ifaddrs *addrs = NULL;[m if (!getifaddrs(&addrs)) {[m for (struct ifaddrs *i = addrs; i; i = i->ifa_next) {[m [36m@@ -411,6 +412,7 @@[m [miObjectList *networkInterfaces_Address(void) {[m }[m freeifaddrs(addrs);[m }[m [32m+[m[32m#endif[m return list;[m }[m [m [1mdiff --git a/src/platform/posix/process.c b/src/platform/posix/process.c[m [1mindex 1ce5cc0..3d8ed76 100644[m [1m--- a/src/platform/posix/process.c[m [1m+++ b/src/platform/posix/process.c[m [36m@@ -102,6 +102,10 @@[m [mvoid setWorkingDirectory_Process(iProcess *d, const iString *cwd) {[m }[m [m iBool start_Process(iProcess *d) {[m [32m+[m[32m#if defined (iPlatformAndroid)[m [32m+[m[32m /* posix_spawn requires API level 28 */[m [32m+[m[32m return iFalse;[m [32m+[m[32m#else[m posix_spawn_file_actions_t facts;[m int rc;[m const char **argv;[m [36m@@ -147,6 +151,7 @@[m [miBool start_Process(iProcess *d) {[m close(input_Pipe(&d->pout));[m close(input_Pipe(&d->perr));[m return rc == 0;[m [32m+[m[32m#endif[m }[m [m iProcessId pid_Process(const iProcess *d) {[m [1mdiff --git a/src/thread.c b/src/thread.c[m [1mindex 4709ff6..98af25b 100644[m [1m--- a/src/thread.c[m [1m+++ b/src/thread.c[m [36m@@ -77,7 +77,7 @@[m [mstatic int run_Threads_(void *arg) {[m #endif[m }[m if (d->flags & terminationEnabled_ThreadFlag) {[m [31m-#if defined (iHavePThread)[m [32m+[m[32m#if defined (iHavePThreadCancel)[m pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);[m #endif[m }[m [36m@@ -186,7 +186,7 @@[m [mvoid join_Thread(iThread *d) {[m [m void terminate_Thread(iThread *d) {[m iAssert(d->flags & terminationEnabled_ThreadFlag);[m [31m-#if defined (iHavePThread)[m [32m+[m[32m#if defined (iHavePThreadCancel)[m pthread_cancel(d->id);[m #endif[m }[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).