Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Upgrade dynamic loading API #120

Merged
merged 7 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set(HUNTER_CONFIGURATION_TYPES "Release;Debug" CACHE STRING
include(CMakeDependentOption)
include(HunterGate)
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.20.70.tar.gz"
SHA1 "95fb7d11f0828746e2983b5f06ff7981a676da3f"
URL "https://github.com/ruslo/hunter/archive/v0.23.5.tar.gz"
SHA1 "2c5c6fc1cf609d0856695d60f147594daf4e6b3e"
)

project(jaegertracing VERSION 0.5.0)
Expand Down Expand Up @@ -255,12 +255,8 @@ if(BUILD_TESTING)
src/jaegertracing/testutils/TracerUtil.cpp)
target_link_libraries(testutils PUBLIC ${JAEGERTRACING_LIB})

if(BUILD_SHARED_LIBS)
set(dynamic_load_test_src src/jaegertracing/DynamicLoadTest.cpp)
endif()
add_executable(UnitTest
src/jaegertracing/ConfigTest.cpp
${dynamic_load_test_src}
src/jaegertracing/ReferenceTest.cpp
src/jaegertracing/SpanContextTest.cpp
src/jaegertracing/SpanTest.cpp
Expand All @@ -286,9 +282,6 @@ if(BUILD_TESTING)
src/jaegertracing/utils/ErrorUtilTest.cpp
src/jaegertracing/utils/RateLimiterTest.cpp
src/jaegertracing/utils/UDPClientTest.cpp)
target_compile_definitions(UnitTest PUBLIC
GTEST_HAS_TR1_TUPLE=0
GTEST_USE_OWN_TR1_TUPLE=0)
target_link_libraries(
UnitTest PRIVATE testutils GTest::main)
add_test(NAME UnitTest COMMAND UnitTest)
Expand Down
16 changes: 10 additions & 6 deletions src/jaegertracing/DynamicLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@

#include <opentracing/dynamic_load.h>

#include "TracerFactory.h"
#include "jaegertracing/Tracer.h"
#include "jaegertracing/TracerFactory.h"

int OpenTracingMakeTracerFactory(const char* opentracingVersion,
const void** errorCategory,
void** tracerFactory)
static int makeTracerFactory(const char* opentracingVersion,
const char* opentracingABIVersion,
const void** errorCategory,
void* errorMessage,
void** tracerFactory)
{
assert(errorCategory != nullptr);
assert(tracerFactory != nullptr);
#ifndef JAEGERTRACING_WITH_YAML_CPP
*errorCategory =
static_cast<const void*>(&opentracing::dynamic_load_error_category());
static_cast<const void*>(&opentracing::dynamic_load_errorCategory());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dynamic_load_errorCategory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol I was camelcasing this stuff an must have messed that up. Surprised this built...

return opentracing::dynamic_load_not_supported_error.value();
#endif
if (std::strcmp(opentracingVersion, OPENTRACING_VERSION) != 0) {
if (std::strcmp(opentracingABIVersion, OPENTRACING_ABI_VERSION) != 0) {
*errorCategory = static_cast<const void*>(
&opentracing::dynamic_load_error_category());
return opentracing::incompatible_library_versions_error.value();
Expand All @@ -47,3 +49,5 @@ int OpenTracingMakeTracerFactory(const char* opentracingVersion,

return 0;
}

OPENTRACING_DECLARE_IMPL_FACTORY(makeTracerFactory)
99 changes: 0 additions & 99 deletions src/jaegertracing/DynamicLoadTest.cpp

This file was deleted.

1 change: 1 addition & 0 deletions src/jaegertracing/TracerFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class TracerFactory : public opentracing::TracerFactory {
MakeTracer(const char* configuration, std::string& errorMessage) const
noexcept override;
};

} // namespace jaegertracing

#endif // JAEGERTRACING_TRACER_FACTORY_H