Skip to content

Commit 948b70b

Browse files
mobilebenBillyONeal
authored andcommitted
Various fixes on #866 which broke building for iOS and Mac (#888)
* Various fixes on #866 which broke building for iOS and Mac * Remove trailing semicolon from namespace since flags error when building on Ubuntu * Ubuntu builds needs to factor in unused arguments/variables * Remove trailing spaces from empty lines * Remove duplicate bind_impls. * Fix some merge fallout with master.
1 parent 98550a4 commit 948b70b

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

Release/include/cpprest/http_headers.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "cpprest/asyncrt_utils.h"
1919

2020
namespace web { namespace http {
21-
2221
/// <summary>
2322
/// Binds an individual reference to a string value.
2423
/// </summary>
@@ -250,7 +249,7 @@ class http_headers
250249
return false;
251250
}
252251

253-
return details::bind_impl(iter->second, value) || iter->second.empty();
252+
return web::http::details::bind_impl(iter->second, value) || iter->second.empty();
254253
}
255254

256255
/// <summary>

Release/src/http/common/http_compression.cpp

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class zlib_compressor_base : public compress_provider
156156

157157
private:
158158
int m_state{Z_BUF_ERROR};
159-
z_stream m_stream{0};
159+
z_stream m_stream{};
160160
const utility::string_t& m_algorithm;
161161
};
162162

@@ -263,7 +263,7 @@ class zlib_decompressor_base : public decompress_provider
263263

264264
private:
265265
int m_state{Z_BUF_ERROR};
266-
z_stream m_stream{0};
266+
z_stream m_stream{};
267267
const utility::string_t& m_algorithm;
268268
};
269269

@@ -283,7 +283,7 @@ class gzip_compressor : public zlib_compressor_base
283283
class gzip_decompressor : public zlib_decompressor_base
284284
{
285285
public:
286-
gzip_decompressor::gzip_decompressor() : zlib_decompressor_base(16) // gzip auto-detect
286+
gzip_decompressor() : zlib_decompressor_base(16) // gzip auto-detect
287287
{
288288
}
289289
};
@@ -634,14 +634,14 @@ class generic_decompress_factory : public decompress_factory
634634
static const std::vector<std::shared_ptr<compress_factory>> g_compress_factories
635635
#if defined(CPPREST_HTTP_COMPRESSION)
636636
= {std::make_shared<generic_compress_factory>(
637-
algorithm::GZIP, []() -> std::unique_ptr<compress_provider> { return std::make_unique<gzip_compressor>(); }),
637+
algorithm::GZIP, []() -> std::unique_ptr<compress_provider> { return utility::details::make_unique<gzip_compressor>(); }),
638638
std::make_shared<generic_compress_factory>(
639639
algorithm::DEFLATE,
640-
[]() -> std::unique_ptr<compress_provider> { return std::make_unique<deflate_compressor>(); }),
640+
[]() -> std::unique_ptr<compress_provider> { return utility::details::make_unique<deflate_compressor>(); }),
641641
#if defined(CPPREST_BROTLI_COMPRESSION)
642642
std::make_shared<generic_compress_factory>(
643643
algorithm::BROTLI,
644-
[]() -> std::unique_ptr<compress_provider> { return std::make_unique<brotli_compressor>(); })
644+
[]() -> std::unique_ptr<compress_provider> { return utility::details::make_unique<brotli_compressor>(); })
645645
#endif // CPPREST_BROTLI_COMPRESSION
646646
};
647647
#else // CPPREST_HTTP_COMPRESSION
@@ -653,16 +653,16 @@ static const std::vector<std::shared_ptr<decompress_factory>> g_decompress_facto
653653
= {std::make_shared<generic_decompress_factory>(
654654
algorithm::GZIP,
655655
500,
656-
[]() -> std::unique_ptr<decompress_provider> { return std::make_unique<gzip_decompressor>(); }),
656+
[]() -> std::unique_ptr<decompress_provider> { return utility::details::make_unique<gzip_decompressor>(); }),
657657
std::make_shared<generic_decompress_factory>(
658658
algorithm::DEFLATE,
659659
500,
660-
[]() -> std::unique_ptr<decompress_provider> { return std::make_unique<deflate_decompressor>(); }),
660+
[]() -> std::unique_ptr<decompress_provider> { return utility::details::make_unique<deflate_decompressor>(); }),
661661
#if defined(CPPREST_BROTLI_COMPRESSION)
662662
std::make_shared<generic_decompress_factory>(
663663
algorithm::BROTLI,
664664
500,
665-
[]() -> std::unique_ptr<decompress_provider> { return std::make_unique<brotli_decompressor>(); })
665+
[]() -> std::unique_ptr<decompress_provider> { return utility::details::make_unique<brotli_decompressor>(); })
666666
#endif // CPPREST_BROTLI_COMPRESSION
667667
};
668668
#else // CPPREST_HTTP_COMPRESSION
@@ -748,10 +748,11 @@ std::shared_ptr<decompress_factory> get_decompress_factory(const utility::string
748748
return std::shared_ptr<decompress_factory>();
749749
}
750750

751+
751752
std::unique_ptr<compress_provider> make_gzip_compressor(int compressionLevel, int method, int strategy, int memLevel)
752753
{
753754
#if defined(CPPREST_HTTP_COMPRESSION)
754-
return std::move(std::make_unique<gzip_compressor>(compressionLevel, method, strategy, memLevel));
755+
return utility::details::make_unique<gzip_compressor>(compressionLevel, method, strategy, memLevel);
755756
#else // CPPREST_HTTP_COMPRESSION
756757
(void)compressionLevel;
757758
(void)method;
@@ -760,11 +761,11 @@ std::unique_ptr<compress_provider> make_gzip_compressor(int compressionLevel, in
760761
return std::unique_ptr<compress_provider>();
761762
#endif // CPPREST_HTTP_COMPRESSION
762763
}
763-
764+
764765
std::unique_ptr<compress_provider> make_deflate_compressor(int compressionLevel, int method, int strategy, int memLevel)
765766
{
766767
#if defined(CPPREST_HTTP_COMPRESSION)
767-
return std::move(std::make_unique<deflate_compressor>(compressionLevel, method, strategy, memLevel));
768+
return utility::details::make_unique<deflate_compressor>(compressionLevel, method, strategy, memLevel);
768769
#else // CPPREST_HTTP_COMPRESSION
769770
(void)compressionLevel;
770771
(void)method;
@@ -777,7 +778,7 @@ std::unique_ptr<compress_provider> make_deflate_compressor(int compressionLevel,
777778
std::unique_ptr<compress_provider> make_brotli_compressor(uint32_t window, uint32_t quality, uint32_t mode)
778779
{
779780
#if defined(CPPREST_HTTP_COMPRESSION) && defined(CPPREST_BROTLI_COMPRESSION)
780-
return std::move(std::make_unique<brotli_compressor>(window, quality, mode));
781+
return utility::details::make_unique<brotli_compressor>(window, quality, mode);
781782
#else // CPPREST_BROTLI_COMPRESSION
782783
(void)window;
783784
(void)quality;
@@ -962,7 +963,7 @@ std::unique_ptr<compress_provider> get_compressor_from_header(
962963

963964
if (compressor)
964965
{
965-
return std::move(compressor);
966+
return compressor;
966967
}
967968

968969
// If we're here, we didn't match the caller's compressor above;
@@ -976,7 +977,7 @@ std::unique_ptr<compress_provider> get_compressor_from_header(
976977
auto compressor = web::http::compression::builtin::_make_compressor(f, coding);
977978
if (compressor)
978979
{
979-
return std::move(compressor);
980+
return compressor;
980981
}
981982
if (type == header_types::accept_encoding && utility::details::str_iequal(coding, _XPLATSTR("identity")))
982983
{
@@ -1079,7 +1080,7 @@ std::unique_ptr<decompress_provider> get_decompressor_from_header(
10791080

10801081
// Either the response is compressed and we have a decompressor that can handle it, or
10811082
// built-in compression is not enabled and we don't have an alternate set of decompressors
1082-
return std::move(decompressor);
1083+
return decompressor;
10831084
}
10841085

10851086
utility::string_t build_supported_header(header_types type,
@@ -1120,7 +1121,7 @@ utility::string_t build_supported_header(header_types type,
11201121
os << _XPLATSTR("identity;q=1, *;q=0");
11211122
}
11221123

1123-
return std::move(os.str());
1124+
return os.str();
11241125
}
11251126
} // namespace details
11261127
} // namespace compression

0 commit comments

Comments
 (0)