make android compile

pull/729/head
Jeff Becker 5 years ago
parent 515b8f2b76
commit 909e0399d6
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -1,5 +1,5 @@
#include <llarp.h> #include <llarp.h>
#include <config.hpp> #include <config/config.hpp>
#include <util/fs.hpp> #include <util/fs.hpp>
#include <jni.h> #include <jni.h>
@ -40,7 +40,7 @@ struct AndroidMain
m_impl = llarp_main_init(configFile.c_str(), true); m_impl = llarp_main_init(configFile.c_str(), true);
if(m_impl == nullptr) if(m_impl == nullptr)
return false; return false;
if(llarp_main_setup(m_impl)) if(llarp_main_setup(m_impl, false))
{ {
llarp_main_free(m_impl); llarp_main_free(m_impl);
m_impl = nullptr; m_impl = nullptr;

@ -6,7 +6,7 @@ namespace llarp
{ {
void void
AndroidLogStream::PreLog(std::stringstream& ss, LogLevel lvl, AndroidLogStream::PreLog(std::stringstream& ss, LogLevel lvl,
const char* fname, int lineno) const const char* fname, int lineno, const std::string&) const
{ {
switch(lvl) switch(lvl)
{ {
@ -31,7 +31,7 @@ namespace llarp
} }
void void
AndroidLogStream::PostLog(std::stingstream&) const AndroidLogStream::PostLog(std::stringstream&) const
{ {
} }

@ -1,5 +1,5 @@
#ifndef LLARP_UTIL_OSTREAM_LOGGER_HPP #ifndef LLARP_UTIL_ANDROID_LOGGER_HPP
#define LLARP_UTIL_OSTREAM_LOGGER_HPP #define LLARP_UTIL_ANDROID_LOGGER_HPP
#include <util/logstream.hpp> #include <util/logstream.hpp>
#include <iostream> #include <iostream>
@ -10,13 +10,13 @@ namespace llarp
{ {
void void
PreLog(std::stringstream& s, LogLevel lvl, const char* fname, PreLog(std::stringstream& s, LogLevel lvl, const char* fname,
int lineno) const override; int lineno, const std::string& nodename) const override;
void void
Log(LogLevel lvl, const std::string& msg) override; Print(LogLevel lvl,const char* filename, const std::string& msg) override;
void void
PostLog(std::stringstream&) const override{}; PostLog(std::stringstream&) const override;
void Tick(llarp_time_t) override; void Tick(llarp_time_t) override;
}; };

@ -11,9 +11,7 @@ namespace llarp
/// logger stream interface /// logger stream interface
struct ILogStream struct ILogStream
{ {
virtual ~ILogStream() virtual ~ILogStream() = default;
{
}
virtual void virtual void
PreLog(std::stringstream& out, LogLevel lvl, const char* fname, int lineno, PreLog(std::stringstream& out, LogLevel lvl, const char* fname, int lineno,

@ -187,13 +187,15 @@ tuntap_sys_set_ipv4(struct device *dev, t_tun_in_addr *s4, uint32_t bits)
return 0; return 0;
} }
#if defined(ANDROID)
#else
struct in6_ifreq { struct in6_ifreq {
struct in6_addr ifr6_addr; struct in6_addr ifr6_addr;
__u32 ifr6_prefixlen; __u32 ifr6_prefixlen;
unsigned int ifr6_ifindex; unsigned int ifr6_ifindex;
}; };
#endif
int int
tuntap_sys_set_ipv6(struct device *dev, t_tun_in6_addr *s6, uint32_t bits) tuntap_sys_set_ipv6(struct device *dev, t_tun_in6_addr *s6, uint32_t bits)

Loading…
Cancel
Save