Comments (3)
this fixes the issue, though it may be cleaner to have a wrapper function for __android_log_vprint to reduce duplication
diff --git a/src/libmatrix/log.cc b/src/libmatrix/log.cc
index d203c6d..b4384f6 100644
--- a/src/libmatrix/log.cc
+++ b/src/libmatrix/log.cc
@@ -109,6 +109,9 @@ Log::info(const char *fmt, ...)
static const string infoprefix("Info");
const string& prefix(do_debug_ ? infoprefix : empty);
va_list ap;
+#ifdef ANDROID
+ va_list aq;
+#endif
va_start(ap, fmt);
#ifndef ANDROID
@@ -116,7 +119,9 @@ Log::info(const char *fmt, ...)
const string& color(do_debug_ ? infocolor : empty);
print_prefixed_message(std::cout, color, prefix, fmt, ap);
#else
- __android_log_vprint(ANDROID_LOG_INFO, appname_.c_str(), fmt, ap);
+ va_copy(aq, ap);
+ __android_log_vprint(ANDROID_LOG_INFO, appname_.c_str(), fmt, aq);
+ va_end(aq);
#endif
if (extra_out_)
@@ -132,13 +137,18 @@ Log::debug(const char *fmt, ...)
if (!do_debug_)
return;
va_list ap;
+#ifdef ANDROID
+ va_list aq;
+#endif
va_start(ap, fmt);
#ifndef ANDROID
static const string& dbgcolor(isatty(fileno(stdout)) ? terminal_color_yellow : empty);
print_prefixed_message(std::cout, dbgcolor, dbgprefix, fmt, ap);
#else
- __android_log_vprint(ANDROID_LOG_DEBUG, appname_.c_str(), fmt, ap);
+ va_copy(aq, ap);
+ __android_log_vprint(ANDROID_LOG_DEBUG, appname_.c_str(), fmt, aq);
+ va_end(aq);
#endif
if (extra_out_)
@@ -152,13 +162,18 @@ Log::error(const char *fmt, ...)
{
static const string errprefix("Error");
va_list ap;
+#ifdef ANDROID
+ va_list aq;
+#endif
va_start(ap, fmt);
#ifndef ANDROID
static const string& errcolor(isatty(fileno(stderr)) ? terminal_color_red : empty);
print_prefixed_message(std::cerr, errcolor, errprefix, fmt, ap);
#else
- __android_log_vprint(ANDROID_LOG_ERROR, appname_.c_str(), fmt, ap);
+ va_copy(aq, ap);
+ __android_log_vprint(ANDROID_LOG_ERROR, appname_.c_str(), fmt, aq);
+ va_end(aq);
#endif
if (extra_out_)
from glmark2.
Thanks for the report and fix. Could you try the proposed MR at #225 and let me know if it works well for you?
from glmark2.
seems to work 👍
from glmark2.
Related Issues (20)
- main: Could not initialize canvas HOT 3
- Strange scores on Raspberry Pi HOT 2
- ERROR: 0:5: 'highp' : precision is not supported in fragment shader HOT 1
- Support for NWS (null windowing system) HOT 1
- GLMark2 GBM Flavor doesn't compile with Python WAF HOT 2
- GLMark2 GBM Vivante GPU Driver HOT 4
- Glmark2 Rendered Frame Size issue
- Flatpak / Flathub HOT 1
- glmark2-wayland --fullscreen on a 200% scaled monitor is clipped HOT 3
- Latest version of glmark2 compiles but does not run on Ubuntu 22.04 on arm64 device HOT 6
- 7900 XTX scores WAY too low HOT 7
- offscreen mode throttled
- glmark2 starts but then immediately closes HOT 3
- For NVIDIA, glmark2 should use gbm_surface_create_with_modifiers HOT 1
- help ~ HOT 1
- could you give a recompiled release file in release?
- glmark2 performance drops when screen is rotated to 90/270
- I'd like to get the .3ds loading functions. HOT 2
- Can not run glmark2-es2-drm --off-screen --fullscreen
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glmark2.