Skip to content

Commit

Permalink
attempt to fix compilation on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Dec 12, 2024
1 parent 06dff6d commit 15347e4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
10 changes: 4 additions & 6 deletions libs/client-sdk/src/bindings/c/builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ using namespace launchdarkly::client_side;
#define FROM_CUSTOM_PERSISTENCE_BUILDER(ptr) \
(reinterpret_cast<LDPersistenceCustomBuilder>(ptr))

#define TO_TLS_BUILDER(ptr) \
(reinterpret_cast<HttpPropertiesBuilder::TlsBuilder*>(ptr))
#define TO_TLS_BUILDER(ptr) (reinterpret_cast<TlsBuilder*>(ptr))

#define FROM_TLS_BUILDER(ptr) \
(reinterpret_cast<LDClientHttpPropertiesTlsBuilder>(ptr))

#define TO_PROXY_BUILDER(ptr) \
(reinterpret_cast<HttpPropertiesBuilder::ProxyBuilder*>(ptr))
#define TO_PROXY_BUILDER(ptr) (reinterpret_cast<ProxyBuilder*>(ptr))

#define FROM_PROXY_BUILDER(ptr) \
(reinterpret_cast<LDClientHttpPropertiesProxyBuilder>(ptr))
Expand Down Expand Up @@ -320,7 +318,7 @@ LDClientConfigBuilder_HttpProperties_Header(LDClientConfigBuilder b,

LD_EXPORT(LDClientHttpPropertiesProxyBuilder)
LDClientHttpPropertiesProxyBuilder_New(void) {
return FROM_PROXY_BUILDER(new HttpPropertiesBuilder::ProxyBuilder());
return FROM_PROXY_BUILDER(new ProxyBuilder());
}

LD_EXPORT(void)
Expand Down Expand Up @@ -383,7 +381,7 @@ LDClientHttpPropertiesTlsBuilder_CustomCAFile(

LD_EXPORT(LDClientHttpPropertiesTlsBuilder)
LDClientHttpPropertiesTlsBuilder_New(void) {
return FROM_TLS_BUILDER(new HttpPropertiesBuilder::TlsBuilder());
return FROM_TLS_BUILDER(new TlsBuilder());
}

LD_EXPORT(void)
Expand Down
1 change: 1 addition & 0 deletions libs/common/include/launchdarkly/config/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ using DataSourceBuilder = config::shared::builders::DataSourceBuilder<SDK>;
using LoggingBuilder = config::shared::builders::LoggingBuilder;
using PersistenceBuilder = config::shared::builders::PersistenceBuilder<SDK>;
using TlsBuilder = config::shared::builders::TlsBuilder<SDK>;
using ProxyBuilder = config::shared::builders::ProxyBuilder<SDK>;

using Config = config::Config<SDK>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ class ProxyBuilder {
template <typename SDK>
class HttpPropertiesBuilder {
public:
using TlsBuilder = TlsBuilder<SDK>;
using ProxyBuilder = ProxyBuilder<SDK>;

/**
* Construct a new HttpPropertiesBuilder. The builder will use the default
* properties based on the SDK type. Setting a property will override
Expand Down Expand Up @@ -222,14 +219,14 @@ class HttpPropertiesBuilder {
* @param builder The TLS property builder.
* @return A reference to this builder.
*/
HttpPropertiesBuilder& Tls(TlsBuilder builder);
HttpPropertiesBuilder& Tls(TlsBuilder<SDK> builder);

/**
*
* @param builder Sets the builder for proxy properties.
* @return A reference to this builder.
*/
HttpPropertiesBuilder& Proxy(ProxyBuilder builder);
HttpPropertiesBuilder& Proxy(ProxyBuilder<SDK> builder);

[[nodiscard]] built::HttpProperties Build() const;

Expand All @@ -241,8 +238,8 @@ class HttpPropertiesBuilder {
std::string wrapper_name_;
std::string wrapper_version_;
std::map<std::string, std::string> base_headers_;
TlsBuilder tls_;
ProxyBuilder proxy_;
TlsBuilder<SDK> tls_;
ProxyBuilder<SDK> proxy_;
};

} // namespace launchdarkly::config::shared::builders
4 changes: 2 additions & 2 deletions libs/common/src/config/http_properties_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ HttpPropertiesBuilder<SDK>& HttpPropertiesBuilder<SDK>::Header(

template <typename SDK>
HttpPropertiesBuilder<SDK>& HttpPropertiesBuilder<SDK>::Tls(
TlsBuilder builder) {
TlsBuilder<SDK> builder) {
tls_ = std::move(builder);
return *this;
}

template <typename SDK>
HttpPropertiesBuilder<SDK>& HttpPropertiesBuilder<SDK>::Proxy(
ProxyBuilder builder) {
ProxyBuilder<SDK> builder) {
proxy_ = std::move(builder);
return *this;
}
Expand Down

0 comments on commit 15347e4

Please sign in to comment.