[core] fix various compilation issues
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
'variables': {
|
||||
'cflags_cc': [
|
||||
'<@(opengl_cflags)',
|
||||
'<@(libpng_cflags)',
|
||||
'<@(libjpeg-turbo_cflags)',
|
||||
'<@(nunicode_cflags)',
|
||||
|
||||
@@ -525,11 +525,11 @@ void HTTPCURLRequest::handleResult(CURLcode code) {
|
||||
} else if (responseCode >= 500 && responseCode < 600) {
|
||||
response->error =
|
||||
std::make_unique<Error>(Error::Reason::Server, std::string{ "HTTP status code " } +
|
||||
std::to_string(responseCode));
|
||||
util::toString(responseCode));
|
||||
} else {
|
||||
response->error =
|
||||
std::make_unique<Error>(Error::Reason::Other, std::string{ "HTTP status code " } +
|
||||
std::to_string(responseCode));
|
||||
util::toString(responseCode));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,8 +83,8 @@ PremultipliedImage decodePNG(const uint8_t* data, size_t size) {
|
||||
png_set_sig_bytes(png_ptr, 8);
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
unsigned width = 0;
|
||||
unsigned height = 0;
|
||||
png_uint_32 width = 0;
|
||||
png_uint_32 height = 0;
|
||||
int bit_depth = 0;
|
||||
int color_type = 0;
|
||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
|
||||
|
||||
@@ -147,20 +147,20 @@ Xcode/%: Xcode/__project__
|
||||
|
||||
Ninja/%: Ninja/__project__
|
||||
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Building target $*...$(FORMAT_END)\n"
|
||||
$(QUIET)$(ENV) deps/ninja/ninja-$(HOST) -C build/$(HOST_SLUG)/$(BUILDTYPE) $*
|
||||
$(QUIET)$(ENV) deps/ninja/ninja-$(BUILD) -C build/$(HOST_SLUG)/$(BUILDTYPE) $*
|
||||
|
||||
|
||||
Ninja/compdb: OUTPUT=build/$(HOST_SLUG)/$(BUILDTYPE)/compile_commands.json
|
||||
Ninja/compdb: Ninja/__project__
|
||||
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Writing to $(OUTPUT)$(FORMAT_END)\n"
|
||||
$(QUIET)$(ENV) deps/ninja/ninja-$(HOST) -C build/$(HOST_SLUG)/$(BUILDTYPE) \
|
||||
$(QUIET)$(ENV) deps/ninja/ninja-$(BUILD) -C build/$(HOST_SLUG)/$(BUILDTYPE) \
|
||||
-t compdb cc cc_s cxx objc objcxx > $(OUTPUT)
|
||||
|
||||
#### Tidy ######################################################################
|
||||
|
||||
tidy: Ninja/compdb
|
||||
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Generating header files...$(FORMAT_END)\n"
|
||||
$(QUIET)$(ENV) deps/ninja/ninja-$(HOST) -C build/$(HOST_SLUG)/$(BUILDTYPE) version shaders
|
||||
$(QUIET)$(ENV) deps/ninja/ninja-$(BUILD) -C build/$(HOST_SLUG)/$(BUILDTYPE) version shaders
|
||||
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Running tidy...$(FORMAT_END)\n"
|
||||
@./scripts/clang-tidy.sh
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include <mbgl/util/thread_context.hpp>
|
||||
#include <mbgl/platform/platform.hpp>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
@@ -93,11 +95,13 @@ Thread<Object>::Thread(const ThreadContext& context, Args&&... args) {
|
||||
std::tuple<Args...> params = std::forward_as_tuple(::std::forward<Args>(args)...);
|
||||
|
||||
thread = std::thread([&] {
|
||||
#if defined( __APPLE__)
|
||||
#if defined(__APPLE__)
|
||||
pthread_setname_np(context.name.c_str());
|
||||
#elif defined(__linux__)
|
||||
#elif defined(__GLIBC__) && defined(__GLIBC_PREREQ)
|
||||
#if __GLIBC_PREREQ(2, 12)
|
||||
pthread_setname_np(pthread_self(), context.name.c_str());
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (context.priority == ThreadPriority::Low) {
|
||||
platform::makeThreadLowPriority();
|
||||
|
||||
Reference in New Issue
Block a user