Merge pull request #276 from berolinux/clang-buildfixes
Fix build with clang
This commit is contained in:
commit
a7e9d01dea
10 changed files with 14 additions and 32 deletions
1
external/xdg/xdg.cpp
vendored
1
external/xdg/xdg.cpp
vendored
|
|
@ -57,7 +57,6 @@ constexpr const char* xdg_data_dirs{"XDG_DATA_DIRS"};
|
||||||
constexpr const char* xdg_config_home{"XDG_CONFIG_HOME"};
|
constexpr const char* xdg_config_home{"XDG_CONFIG_HOME"};
|
||||||
constexpr const char* xdg_config_dirs{"XDG_CONFIG_DIRS"};
|
constexpr const char* xdg_config_dirs{"XDG_CONFIG_DIRS"};
|
||||||
constexpr const char* xdg_cache_home{"XDG_CACHE_HOME"};
|
constexpr const char* xdg_cache_home{"XDG_CACHE_HOME"};
|
||||||
constexpr const char* xdg_runtime_dir{"XDG_RUNTIME_DIR"};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace impl
|
namespace impl
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,17 @@
|
||||||
#include "anbox/bridge/android_api_stub.h"
|
#include "anbox/bridge/android_api_stub.h"
|
||||||
#include "anbox/bridge/platform_api_skeleton.h"
|
#include "anbox/bridge/platform_api_skeleton.h"
|
||||||
#include "anbox/bridge/platform_message_processor.h"
|
#include "anbox/bridge/platform_message_processor.h"
|
||||||
|
#include "anbox/graphics/gl_renderer_server.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
std::istream& operator>>(std::istream& in, anbox::graphics::GLRendererServer::Config::Driver& driver);
|
||||||
|
}
|
||||||
|
|
||||||
#include "anbox/cmds/session_manager.h"
|
#include "anbox/cmds/session_manager.h"
|
||||||
#include "anbox/common/dispatcher.h"
|
#include "anbox/common/dispatcher.h"
|
||||||
#include "anbox/config.h"
|
#include "anbox/config.h"
|
||||||
#include "anbox/container/client.h"
|
#include "anbox/container/client.h"
|
||||||
#include "anbox/dbus/skeleton/service.h"
|
#include "anbox/dbus/skeleton/service.h"
|
||||||
#include "anbox/graphics/gl_renderer_server.h"
|
|
||||||
#include "anbox/input/manager.h"
|
#include "anbox/input/manager.h"
|
||||||
#include "anbox/logger.h"
|
#include "anbox/logger.h"
|
||||||
#include "anbox/network/published_socket_connector.h"
|
#include "anbox/network/published_socket_connector.h"
|
||||||
|
|
|
||||||
|
|
@ -35,22 +35,6 @@ inline void* SafePointerFromUInt(unsigned int handle) {
|
||||||
return reinterpret_cast<void*>(static_cast<uintptr_t>(handle));
|
return reinterpret_cast<void*>(static_cast<uintptr_t>(handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned int SafeUIntFromPointer(const void* ptr) {
|
|
||||||
#if 1
|
|
||||||
// Ignore the assert below to avoid crashing when running older
|
|
||||||
// system images, which might have buggy encoder libraries. Print
|
|
||||||
// an error message though.
|
|
||||||
if (reinterpret_cast<uintptr_t>(ptr) != static_cast<unsigned int>(reinterpret_cast<uintptr_t>(ptr))) {
|
|
||||||
WARNING("Bad generic pointer %p", ptr);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
// Assertion error if the pointer contains a value that does not fit
|
|
||||||
// in an unsigned integer!
|
|
||||||
assert((uintptr_t)(ptr) == (unsigned int)(uintptr_t)(ptr));
|
|
||||||
#endif
|
|
||||||
return static_cast<unsigned int>(reinterpret_cast<uintptr_t>(ptr));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lazily create and bind a framebuffer object to the current host context.
|
// Lazily create and bind a framebuffer object to the current host context.
|
||||||
// |fbo| is the address of the framebuffer object name.
|
// |fbo| is the address of the framebuffer object name.
|
||||||
// |tex| is the name of a texture that is attached to the framebuffer object
|
// |tex| is the name of a texture that is attached to the framebuffer object
|
||||||
|
|
|
||||||
|
|
@ -97,16 +97,13 @@ const GLint kIndicesLen = sizeof(kIndices) / sizeof(kIndices[0]);
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TextureDraw::TextureDraw(EGLDisplay display)
|
TextureDraw::TextureDraw(EGLDisplay)
|
||||||
: mDisplay(display),
|
: mVertexShader(0),
|
||||||
mVertexShader(0),
|
|
||||||
mFragmentShader(0),
|
mFragmentShader(0),
|
||||||
mProgram(0),
|
mProgram(0),
|
||||||
mPositionSlot(-1),
|
mPositionSlot(-1),
|
||||||
mInCoordSlot(-1),
|
mInCoordSlot(-1),
|
||||||
mTextureSlot(-1),
|
mTextureSlot(-1) {
|
||||||
mRotationSlot(-1),
|
|
||||||
mTranslationSlot(-1) {
|
|
||||||
// Create shaders and program.
|
// Create shaders and program.
|
||||||
mVertexShader = createShader(GL_VERTEX_SHADER, kVertexShaderSource);
|
mVertexShader = createShader(GL_VERTEX_SHADER, kVertexShaderSource);
|
||||||
mFragmentShader = createShader(GL_FRAGMENT_SHADER, kFragmentShaderSource);
|
mFragmentShader = createShader(GL_FRAGMENT_SHADER, kFragmentShaderSource);
|
||||||
|
|
|
||||||
|
|
@ -42,15 +42,12 @@ class TextureDraw {
|
||||||
bool draw(GLuint texture);
|
bool draw(GLuint texture);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EGLDisplay mDisplay;
|
|
||||||
GLuint mVertexShader;
|
GLuint mVertexShader;
|
||||||
GLuint mFragmentShader;
|
GLuint mFragmentShader;
|
||||||
GLuint mProgram;
|
GLuint mProgram;
|
||||||
GLint mPositionSlot;
|
GLint mPositionSlot;
|
||||||
GLint mInCoordSlot;
|
GLint mInCoordSlot;
|
||||||
GLint mTextureSlot;
|
GLint mTextureSlot;
|
||||||
GLint mRotationSlot;
|
|
||||||
GLint mTranslationSlot;
|
|
||||||
GLuint mVertexBuffer;
|
GLuint mVertexBuffer;
|
||||||
GLuint mIndexBuffer;
|
GLuint mIndexBuffer;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ PublishedSocketConnector::PublishedSocketConnector(
|
||||||
start_accept();
|
start_accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
PublishedSocketConnector::~PublishedSocketConnector() {}
|
PublishedSocketConnector::~PublishedSocketConnector() noexcept {}
|
||||||
|
|
||||||
void PublishedSocketConnector::start_accept() {
|
void PublishedSocketConnector::start_accept() {
|
||||||
auto socket = std::make_shared<boost::asio::local::stream_protocol::socket>(runtime_->service());
|
auto socket = std::make_shared<boost::asio::local::stream_protocol::socket>(runtime_->service());
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ TcpSocketConnector::TcpSocketConnector(
|
||||||
start_accept();
|
start_accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
TcpSocketConnector::~TcpSocketConnector() { acceptor_.cancel(); }
|
TcpSocketConnector::~TcpSocketConnector() noexcept { acceptor_.cancel(); }
|
||||||
|
|
||||||
void TcpSocketConnector::start_accept() {
|
void TcpSocketConnector::start_accept() {
|
||||||
auto socket =
|
auto socket =
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ PipeConnectionCreator::PipeConnectionCreator(const std::shared_ptr<Renderer> &re
|
||||||
std::make_shared<network::Connections<network::SocketConnection>>()) {
|
std::make_shared<network::Connections<network::SocketConnection>>()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PipeConnectionCreator::~PipeConnectionCreator() {
|
PipeConnectionCreator::~PipeConnectionCreator() noexcept {
|
||||||
connections_->clear();
|
connections_->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ ConnectionCreator::ConnectionCreator(const std::shared_ptr<Runtime>& rt,
|
||||||
std::make_shared<network::Connections<network::SocketConnection>>()),
|
std::make_shared<network::Connections<network::SocketConnection>>()),
|
||||||
message_processor_factory_(factory) {}
|
message_processor_factory_(factory) {}
|
||||||
|
|
||||||
ConnectionCreator::~ConnectionCreator() {}
|
ConnectionCreator::~ConnectionCreator() noexcept {}
|
||||||
|
|
||||||
void ConnectionCreator::create_connection_for(
|
void ConnectionCreator::create_connection_for(
|
||||||
std::shared_ptr<boost::asio::local::stream_protocol::socket> const&
|
std::shared_ptr<boost::asio::local::stream_protocol::socket> const&
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ Runtime::Runtime(std::uint32_t pool_size)
|
||||||
strand_{service_},
|
strand_{service_},
|
||||||
keep_alive_{service_} {}
|
keep_alive_{service_} {}
|
||||||
|
|
||||||
Runtime::~Runtime() {
|
Runtime::~Runtime() noexcept(true) {
|
||||||
try {
|
try {
|
||||||
stop();
|
stop();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue