Skip to content

Commit 339e77c

Browse files
authored
Fix macOS building issues (#92)
* - build issue fixed on macos - used make_unique new api in c++14 * updated method signature Co-authored-by: Zahid Zafar <>
1 parent 6a41986 commit 339e77c

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ install_manifest.txt
1919
compile_commands.json
2020
CTestTestfile.cmake
2121
_deps
22+
cmake-build-debug/

include/countly.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ class Countly : public cly::CountlyDelegates {
217217
* Helper methods to fetch remote config from the server.
218218
*/
219219
#pragma region Remote_Config_Helper_Methods
220-
void _fetchRemoteConfig(std::map<std::string, std::string> &data);
221-
void _updateRemoteConfigWithSpecificValues(std::map<std::string, std::string> &data);
220+
void _fetchRemoteConfig(const std::map<std::string, std::string> &data);
221+
void _updateRemoteConfigWithSpecificValues(const std::map<std::string, std::string> &data);
222222
#pragma endregion Remote_Config_Helper_Methods
223223

224224
void processRequestQueue();
225-
void addToRequestQueue(std::string &data);
225+
void addToRequestQueue(const std::string &data);
226226
HTTPResponse sendHTTP(std::string path, std::string data);
227227

228228
void _changeDeviceIdWithMerge(const std::string &value);

src/countly.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ void Countly::processRequestQueue() {
839839
mutex.unlock();
840840
}
841841

842-
void Countly::addToRequestQueue(std::string &data) {
842+
void Countly::addToRequestQueue(const std::string &data) {
843843
if (request_queue.size() >= 1000) {
844844
log(Countly::LogLevel::WARNING, "[Countly][addToRequestQueue] Request Queue is full. Dropping the oldest request.");
845845
request_queue.pop_front();
@@ -1063,7 +1063,7 @@ void Countly::enableRemoteConfig() {
10631063
mutex.unlock();
10641064
}
10651065

1066-
void Countly::_fetchRemoteConfig(std::map<std::string, std::string> &data) {
1066+
void Countly::_fetchRemoteConfig(const std::map<std::string, std::string> &data) {
10671067
HTTPResponse response = sendHTTP("/o/sdk", serializeForm(data));
10681068
mutex.lock();
10691069
if (response.success) {
@@ -1095,7 +1095,7 @@ nlohmann::json Countly::getRemoteConfigValue(const std::string &key) {
10951095
return value;
10961096
}
10971097

1098-
void Countly::_updateRemoteConfigWithSpecificValues(std::map<std::string, std::string> &data) {
1098+
void Countly::_updateRemoteConfigWithSpecificValues(const std::map<std::string, std::string> &data) {
10991099
HTTPResponse response = sendHTTP("/o/sdk", serializeForm(data));
11001100
mutex.lock();
11011101
if (response.success) {

src/logger_module.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#include "countly/logger_module.hpp"
22
#include <iostream>
3+
#include <memory>
34
namespace cly {
45
class LoggerModule::LoggerModuleImpl {
56
public:
6-
LoggerModuleImpl::LoggerModuleImpl() {}
7+
LoggerModuleImpl() {}
78
LoggerFunction logger_function;
89
};
910

10-
LoggerModule::LoggerModule() { impl.reset(new LoggerModuleImpl()); }
11+
LoggerModule::LoggerModule() { impl = std::make_unique<LoggerModuleImpl>(); }
1112

1213
LoggerModule::~LoggerModule() {}
1314

0 commit comments

Comments
 (0)