diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2019-01-20 10:51:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-20 10:51:33 +0100 |
commit | a9684938b382153b3358347bd258843e74036cb6 (patch) | |
tree | 5bb0fff48ae3cc81a2753cf697bd17cd9bfd9ec2 | |
parent | 560f112ae96729e18e2980653ab12b8c399eaabe (diff) | |
parent | 92289dde25e21c35161e8f1de70291afaebcb0a6 (diff) | |
download | ATCD-a9684938b382153b3358347bd258843e74036cb6.tar.gz |
Merge pull request #796 from iguessthislldo/igtd/android
Fixes for ACE Tests on Android
-rw-r--r-- | ACE/ace/config-android.h | 6 | ||||
-rw-r--r-- | ACE/tests/Chrono_Test.cpp | 4 | ||||
-rw-r--r-- | ACE/tests/MM_Shared_Memory_Test.cpp | 4 | ||||
-rw-r--r-- | ACE/tests/SOCK_Connector_Test.cpp | 8 |
4 files changed, 15 insertions, 7 deletions
diff --git a/ACE/ace/config-android.h b/ACE/ace/config-android.h index e9f33307df4..dbe8fc0c95b 100644 --- a/ACE/ace/config-android.h +++ b/ACE/ace/config-android.h @@ -102,6 +102,12 @@ # define ACE_LACKS_CONDATTR_SETCLOCK #endif +// These were available before r18, but in r18 they are restricted to API >= 28 ¯\_(ツ)_/¯ +#if __ANDROID_API__ < 28 +# define ACE_LACKS_SETHOSTENT +# define ACE_LACKS_ENDHOSTENT +#endif + #define ACE_HAS_SSIZE_T // system errorno is a volatile int diff --git a/ACE/tests/Chrono_Test.cpp b/ACE/tests/Chrono_Test.cpp index 7d9d0a10d9e..6cde2a4a2d0 100644 --- a/ACE/tests/Chrono_Test.cpp +++ b/ACE/tests/Chrono_Test.cpp @@ -208,7 +208,9 @@ test_streamers () std::chrono::seconds day_test_ts { day_test_h+day_test_s }; std::chrono::microseconds day_test_tus { day_test_ms+day_test_us }; ACE_Time_Value const test_day { - ACE_Time_Value { day_test_ts.count (), ACE_Utils::truncate_cast<suseconds_t>(day_test_tus.count ()) }}; + ACE_Time_Value { + ACE_Utils::truncate_cast<time_t>(day_test_ts.count ()), + ACE_Utils::truncate_cast<suseconds_t>(day_test_tus.count ())}}; constexpr int expected_min {nr_hours * 60}; constexpr int64_t expected_sec { expected_min * 60 + 54 }; diff --git a/ACE/tests/MM_Shared_Memory_Test.cpp b/ACE/tests/MM_Shared_Memory_Test.cpp index e7e24e06623..66673a0899c 100644 --- a/ACE/tests/MM_Shared_Memory_Test.cpp +++ b/ACE/tests/MM_Shared_Memory_Test.cpp @@ -13,7 +13,6 @@ */ //============================================================================= - #include "test_config.h" #include "ace/Shared_Memory_MM.h" #include "ace/SV_Semaphore_Simple.h" @@ -22,8 +21,7 @@ #include "ace/Lib_Find.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_unistd.h" - - +#include "ace/ACE.h" #if !defined (ACE_LACKS_MMAP) diff --git a/ACE/tests/SOCK_Connector_Test.cpp b/ACE/tests/SOCK_Connector_Test.cpp index e419aeaab2c..cc878c5da5f 100644 --- a/ACE/tests/SOCK_Connector_Test.cpp +++ b/ACE/tests/SOCK_Connector_Test.cpp @@ -20,7 +20,9 @@ #include "ace/OS_NS_sys_utsname.h" #include "ace/OS_NS_netdb.h" - +#if defined(ACE_LACKS_GETHOSTENT) || defined(ACE_LACKS_SETHOSTENT) || defined(ACE_LACKS_ENDHOSTENT) +# define MISSING_HOSTENT_FUNCTIONS +#endif // Host candidate list struct Host_Candidate @@ -31,7 +33,7 @@ struct Host_Candidate const int MAX_CANDIDATES = 50; Host_Candidate candidate[MAX_CANDIDATES]; -#if !defined (ACE_LACKS_GETHOSTENT) +#ifndef MISSING_HOSTENT_FUNCTIONS // Determine if a host exists, is reachable, and is up. Attempt a // blocking connection to it; if it succeeds, then the host exists, is // reachable, and is up. @@ -74,7 +76,7 @@ find_another_host (ACE_TCHAR other_host[]) ACE_OS::strcpy (other_host, ACE_DEFAULT_SERVER_HOST); // If all else fails -#if !defined (ACE_LACKS_GETHOSTENT) +#ifndef MISSING_HOSTENT_FUNCTIONS // These gethost-type things don't work everywhere. struct hostent *h = 0; ACE_utsname un; |