Skip to content

Commit 3cd6001

Browse files
committed
Fix test load issue on android emulator (x86)
Running tests on android emulator throws error "unable to load native library libtestrunner_android.so" due to cannot locate symbol __tls_get_addr This is fixed in latest boost asio repository, however the version we are on still has this bug. To workaround we have defined BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION in cpprest_compat.h however while building the test projects(or an app) this does not get included before the boost asio ssl.hpp headers. Fix our public http headers to include this header after other cpprest headers (which will include cpprest_compat.h)
1 parent bd7e09d commit 3cd6001

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

Release/include/cpprest/details/http_server_asio.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
#pragma once
1616

17+
#include <set>
18+
#include "pplx/threadpool.h"
19+
#include "cpprest/details/http_server.h"
1720
#if defined(__clang__)
1821
#pragma clang diagnostic push
1922
#pragma clang diagnostic ignored "-Wconversion"
@@ -24,9 +27,6 @@
2427
#pragma clang diagnostic pop
2528
#endif
2629
#include <boost/bind.hpp>
27-
#include <set>
28-
#include "pplx/threadpool.h"
29-
#include "cpprest/details/http_server.h"
3030

3131
namespace web
3232
{

Release/include/cpprest/http_client.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ typedef void* native_handle;}}}
4242

4343
#include <memory>
4444
#include <limits>
45-
#if !defined(_WIN32) && !defined(__cplusplus_winrt)
46-
#if defined(__clang__)
47-
#pragma clang diagnostic push
48-
#pragma clang diagnostic ignored "-Wconversion"
49-
#endif
50-
#include "boost/asio/ssl.hpp"
51-
#if defined(__clang__)
52-
#pragma clang diagnostic pop
53-
#endif
54-
#endif
5545

5646
#include "pplx/pplxtasks.h"
5747
#include "cpprest/http_msg.h"
@@ -67,6 +57,17 @@ typedef void* native_handle;}}}
6757

6858
#include "cpprest/oauth2.h"
6959

60+
#if !defined(_WIN32) && !defined(__cplusplus_winrt)
61+
#if defined(__clang__)
62+
#pragma clang diagnostic push
63+
#pragma clang diagnostic ignored "-Wconversion"
64+
#endif
65+
#include "boost/asio/ssl.hpp"
66+
#if defined(__clang__)
67+
#pragma clang diagnostic pop
68+
#endif
69+
#endif
70+
7071
/// The web namespace contains functionality common to multiple protocols like HTTP and WebSockets.
7172
namespace web
7273
{

Release/include/cpprest/http_listener.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@
2929
#include <limits>
3030
#include <functional>
3131

32+
#include "cpprest/http_msg.h"
3233
#if !defined(_WIN32) && !defined(__cplusplus_winrt)
3334
#include <boost/asio/ssl.hpp>
3435
#endif
3536

36-
#include "cpprest/http_msg.h"
37-
3837
#if !defined(_WIN32) || (_WIN32_WINNT >= _WIN32_WINNT_VISTA && !defined(__cplusplus_winrt))
3938

4039
namespace web

Release/src/build/vs14.android/casablanca140.android.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@
118118
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
119119
<ImportGroup Label="ExtensionTargets">
120120
<Import Project="$(PackagesRoot)\openssl-android.1.0.2.0\build\native\openssl-android.targets" Condition="Exists('$(PackagesRoot)\openssl-android.1.0.2.0\build\native\openssl-android.targets')" />
121-
<Import Project="$(PackagesRoot)\boost.1.55.0.16\build\native\boost.targets" Condition="Exists('$(PackagesRoot)\boost.1.59.0.0\build\native\boost.targets')" />
121+
<Import Project="$(PackagesRoot)\boost.1.55.0.16\build\native\boost.targets" Condition="Exists('$(PackagesRoot)\boost.1.55.0.16\build\native\boost.targets')" />
122122
</ImportGroup>
123123
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
124124
<PropertyGroup>
125125
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
126126
</PropertyGroup>
127127
<Error Condition="!Exists('$(PackagesRoot)\openssl-android.1.0.2.0\build\native\openssl-android.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(PackagesRoot)\openssl-android.1.0.2.0\build\native\openssl-android.targets'))" />
128-
<Error Condition="!Exists('$(PackagesRoot)\boost.1.55.0.16\build\native\boost.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(PackagesRoot)\boost.1.59.0.0\build\native\boost.targets'))" />
128+
<Error Condition="!Exists('$(PackagesRoot)\boost.1.55.0.16\build\native\boost.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(PackagesRoot)\boost.1.55.0.16\build\native\boost.targets'))" />
129129
</Target>
130130
</Project>

0 commit comments

Comments
 (0)