- now build without uuid library is possible
This commit is contained in:
parent
0a54d7f7db
commit
c34bcdc058
|
|
@ -3,6 +3,7 @@ project (helper_lib)
|
||||||
# Rely on C++ 11
|
# Rely on C++ 11
|
||||||
set (CMAKE_CXX_STANDARD 11)
|
set (CMAKE_CXX_STANDARD 11)
|
||||||
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set (USE_NULL_UUID OFF CACHE BOOL "When enabled linking to libuuid is avoided")
|
||||||
|
|
||||||
file(GLOB HELPER_LIB_SOURCES "*.cpp" "*.h")
|
file(GLOB HELPER_LIB_SOURCES "*.cpp" "*.h")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ struct MediaStreamId
|
||||||
uint32_t mSSRC = 0;
|
uint32_t mSSRC = 0;
|
||||||
bool mSsrcIsId = true;
|
bool mSsrcIsId = true;
|
||||||
Uuid mLinkId;
|
Uuid mLinkId;
|
||||||
|
|
||||||
bool operator < (const MediaStreamId& s2) const;
|
bool operator < (const MediaStreamId& s2) const;
|
||||||
bool operator == (const MediaStreamId& right) const;
|
bool operator == (const MediaStreamId& right) const;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,25 +11,28 @@ Uuid::Uuid()
|
||||||
Uuid Uuid::generateOne()
|
Uuid Uuid::generateOne()
|
||||||
{
|
{
|
||||||
Uuid result;
|
Uuid result;
|
||||||
|
#if !defined(USE_NULL_UUID)
|
||||||
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
|
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
|
||||||
uuid_generate(result.mUuid);
|
uuid_generate(result.mUuid);
|
||||||
#endif
|
#endif
|
||||||
#if defined(TARGET_WIN)
|
#if defined(TARGET_WIN)
|
||||||
UuidCreate(&result.mUuid);
|
UuidCreate(&result.mUuid);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uuid Uuid::parse(const std::string &s)
|
Uuid Uuid::parse(const std::string &s)
|
||||||
{
|
{
|
||||||
Uuid result;
|
Uuid result;
|
||||||
|
#if !defined(USE_NULL_UUID)
|
||||||
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
|
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
|
||||||
uuid_parse(s.c_str(), result.mUuid);
|
uuid_parse(s.c_str(), result.mUuid);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TARGET_WIN)
|
#if defined(TARGET_WIN)
|
||||||
UuidFromStringA((RPC_CSTR)s.c_str(), &result.mUuid);
|
UuidFromStringA((RPC_CSTR)s.c_str(), &result.mUuid);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -37,6 +40,9 @@ Uuid Uuid::parse(const std::string &s)
|
||||||
std::string Uuid::toString() const
|
std::string Uuid::toString() const
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
#if defined(USE_NULL_UUID)
|
||||||
|
return "UUID_disabled";
|
||||||
|
#else
|
||||||
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
|
#if defined(TARGET_LINUX) || defined(TARGET_OSX)
|
||||||
uuid_unparse_lower(mUuid, buf);
|
uuid_unparse_lower(mUuid, buf);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -53,6 +59,7 @@ std::string Uuid::toString() const
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Uuid::operator < (const Uuid& right) const
|
bool Uuid::operator < (const Uuid& right) const
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue