Skip to content

Commit

Permalink
Various fixes on #866 which broke building for iOS and Mac (#888)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
mobileben authored and BillyONeal committed Oct 9, 2018
1 parent 98550a4 commit 948b70b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
3 changes: 1 addition & 2 deletions Release/include/cpprest/http_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "cpprest/asyncrt_utils.h"

namespace web { namespace http {

/// <summary>
/// Binds an individual reference to a string value.
/// </summary>
Expand Down Expand Up @@ -250,7 +249,7 @@ class http_headers
return false;
}

return details::bind_impl(iter->second, value) || iter->second.empty();
return web::http::details::bind_impl(iter->second, value) || iter->second.empty();
}

/// <summary>
Expand Down
35 changes: 18 additions & 17 deletions Release/src/http/common/http_compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class zlib_compressor_base : public compress_provider

private:
int m_state{Z_BUF_ERROR};
z_stream m_stream{0};
z_stream m_stream{};
const utility::string_t& m_algorithm;
};

Expand Down Expand Up @@ -263,7 +263,7 @@ class zlib_decompressor_base : public decompress_provider

private:
int m_state{Z_BUF_ERROR};
z_stream m_stream{0};
z_stream m_stream{};
const utility::string_t& m_algorithm;
};

Expand All @@ -283,7 +283,7 @@ class gzip_compressor : public zlib_compressor_base
class gzip_decompressor : public zlib_decompressor_base
{
public:
gzip_decompressor::gzip_decompressor() : zlib_decompressor_base(16) // gzip auto-detect
gzip_decompressor() : zlib_decompressor_base(16) // gzip auto-detect
{
}
};
Expand Down Expand Up @@ -634,14 +634,14 @@ class generic_decompress_factory : public decompress_factory
static const std::vector<std::shared_ptr<compress_factory>> g_compress_factories
#if defined(CPPREST_HTTP_COMPRESSION)
= {std::make_shared<generic_compress_factory>(
algorithm::GZIP, []() -> std::unique_ptr<compress_provider> { return std::make_unique<gzip_compressor>(); }),
algorithm::GZIP, []() -> std::unique_ptr<compress_provider> { return utility::details::make_unique<gzip_compressor>(); }),
std::make_shared<generic_compress_factory>(
algorithm::DEFLATE,
[]() -> std::unique_ptr<compress_provider> { return std::make_unique<deflate_compressor>(); }),
[]() -> std::unique_ptr<compress_provider> { return utility::details::make_unique<deflate_compressor>(); }),
#if defined(CPPREST_BROTLI_COMPRESSION)
std::make_shared<generic_compress_factory>(
algorithm::BROTLI,
[]() -> std::unique_ptr<compress_provider> { return std::make_unique<brotli_compressor>(); })
[]() -> std::unique_ptr<compress_provider> { return utility::details::make_unique<brotli_compressor>(); })
#endif // CPPREST_BROTLI_COMPRESSION
};
#else // CPPREST_HTTP_COMPRESSION
Expand All @@ -653,16 +653,16 @@ static const std::vector<std::shared_ptr<decompress_factory>> g_decompress_facto
= {std::make_shared<generic_decompress_factory>(
algorithm::GZIP,
500,
[]() -> std::unique_ptr<decompress_provider> { return std::make_unique<gzip_decompressor>(); }),
[]() -> std::unique_ptr<decompress_provider> { return utility::details::make_unique<gzip_decompressor>(); }),
std::make_shared<generic_decompress_factory>(
algorithm::DEFLATE,
500,
[]() -> std::unique_ptr<decompress_provider> { return std::make_unique<deflate_decompressor>(); }),
[]() -> std::unique_ptr<decompress_provider> { return utility::details::make_unique<deflate_decompressor>(); }),
#if defined(CPPREST_BROTLI_COMPRESSION)
std::make_shared<generic_decompress_factory>(
algorithm::BROTLI,
500,
[]() -> std::unique_ptr<decompress_provider> { return std::make_unique<brotli_decompressor>(); })
[]() -> std::unique_ptr<decompress_provider> { return utility::details::make_unique<brotli_decompressor>(); })
#endif // CPPREST_BROTLI_COMPRESSION
};
#else // CPPREST_HTTP_COMPRESSION
Expand Down Expand Up @@ -748,10 +748,11 @@ std::shared_ptr<decompress_factory> get_decompress_factory(const utility::string
return std::shared_ptr<decompress_factory>();
}


std::unique_ptr<compress_provider> make_gzip_compressor(int compressionLevel, int method, int strategy, int memLevel)
{
#if defined(CPPREST_HTTP_COMPRESSION)
return std::move(std::make_unique<gzip_compressor>(compressionLevel, method, strategy, memLevel));
return utility::details::make_unique<gzip_compressor>(compressionLevel, method, strategy, memLevel);
#else // CPPREST_HTTP_COMPRESSION
(void)compressionLevel;
(void)method;
Expand All @@ -760,11 +761,11 @@ std::unique_ptr<compress_provider> make_gzip_compressor(int compressionLevel, in
return std::unique_ptr<compress_provider>();
#endif // CPPREST_HTTP_COMPRESSION
}

std::unique_ptr<compress_provider> make_deflate_compressor(int compressionLevel, int method, int strategy, int memLevel)
{
#if defined(CPPREST_HTTP_COMPRESSION)
return std::move(std::make_unique<deflate_compressor>(compressionLevel, method, strategy, memLevel));
return utility::details::make_unique<deflate_compressor>(compressionLevel, method, strategy, memLevel);
#else // CPPREST_HTTP_COMPRESSION
(void)compressionLevel;
(void)method;
Expand All @@ -777,7 +778,7 @@ std::unique_ptr<compress_provider> make_deflate_compressor(int compressionLevel,
std::unique_ptr<compress_provider> make_brotli_compressor(uint32_t window, uint32_t quality, uint32_t mode)
{
#if defined(CPPREST_HTTP_COMPRESSION) && defined(CPPREST_BROTLI_COMPRESSION)
return std::move(std::make_unique<brotli_compressor>(window, quality, mode));
return utility::details::make_unique<brotli_compressor>(window, quality, mode);
#else // CPPREST_BROTLI_COMPRESSION
(void)window;
(void)quality;
Expand Down Expand Up @@ -962,7 +963,7 @@ std::unique_ptr<compress_provider> get_compressor_from_header(

if (compressor)
{
return std::move(compressor);
return compressor;
}

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

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

utility::string_t build_supported_header(header_types type,
Expand Down Expand Up @@ -1120,7 +1121,7 @@ utility::string_t build_supported_header(header_types type,
os << _XPLATSTR("identity;q=1, *;q=0");
}

return std::move(os.str());
return os.str();
}
} // namespace details
} // namespace compression
Expand Down

0 comments on commit 948b70b

Please sign in to comment.