Avoid using std::format for github CI
This commit is contained in:
@@ -118,9 +118,14 @@ void avahi_publisher::client_callback(AvahiClient * s,
|
||||
}
|
||||
}
|
||||
|
||||
avahi_publisher::avahi_publisher(const char * name, std::string type, int port, std::vector<std::string> txt) :
|
||||
name(avahi_strdup(name)), type(std::move(type)), port(port), txt(txt)
|
||||
avahi_publisher::avahi_publisher(const char * name, std::string type, int port, const std::map<std::string, std::string>& txt) :
|
||||
name(avahi_strdup(name)), type(std::move(type)), port(port)
|
||||
{
|
||||
for(const auto& [key, value]: txt)
|
||||
{
|
||||
this->txt.push_back(key + "=" + value);
|
||||
}
|
||||
|
||||
avahi_poll = avahi_simple_poll_new();
|
||||
|
||||
int error;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <avahi-client/publish.h>
|
||||
#include <avahi-common/simple-watch.h>
|
||||
#include <avahi-common/watch.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -31,7 +32,7 @@ class avahi_publisher
|
||||
void * userdata /**< The user data that was passed to avahi_client_new() */);
|
||||
|
||||
public:
|
||||
avahi_publisher(const char * name, std::string type, int port, std::vector<std::string> txt = {});
|
||||
avahi_publisher(const char * name, std::string type, int port, const std::map<std::string, std::string>& txt = {});
|
||||
|
||||
~avahi_publisher();
|
||||
|
||||
|
||||
+5
-3
@@ -188,10 +188,12 @@ int inner_main(int argc, char * argv[])
|
||||
fcntl(pipe_fds[0], F_SETFD, FD_CLOEXEC);
|
||||
fcntl(pipe_fds[1], F_SETFD, FD_CLOEXEC);
|
||||
|
||||
std::vector<std::string> TXT;
|
||||
TXT.push_back(std::format("protocol={:16x}", xrt::drivers::wivrn::protocol_version));
|
||||
TXT.push_back(std::format("version={}", (const char*)xrt::drivers::wivrn::git_version));
|
||||
char protocol_string[17];
|
||||
sprintf(protocol_string, "%016lx", xrt::drivers::wivrn::protocol_version);
|
||||
|
||||
std::map<std::string, std::string> TXT;
|
||||
TXT["protocol"] = protocol_string;
|
||||
TXT["version"] = xrt::drivers::wivrn::git_version;
|
||||
|
||||
bool quit = false;
|
||||
while (!quit)
|
||||
|
||||
Reference in New Issue
Block a user