mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-11-15 16:07:09 +00:00
Fastpath no-logging, don't do normal logging in release but provide a means to RELEASE_LOG()
This commit is contained in:
parent
5a8aa065a9
commit
1a32756bd4
@ -100,7 +100,7 @@ void log_outputString(const char * const str) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (UNLIKELY(!do_logging)) {
|
||||
if (LIKELY(!do_logging)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -71,8 +71,7 @@ void log_outputString(const char * const str);
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#ifdef ANDROID
|
||||
#if defined(__ANDROID__)
|
||||
// Apparently some non-conformant Android devices (ahem, Spamsung, ahem) do not actually let me see what the assert
|
||||
// actually was before aborting/segfaulting ...
|
||||
# undef assert
|
||||
@ -95,9 +94,13 @@ void log_outputString(const char * const str);
|
||||
# undef assert
|
||||
# define assert(e)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define LOG(...) \
|
||||
# define LOG(...)
|
||||
# define GL_MAYBELOG(...)
|
||||
|
||||
#else
|
||||
|
||||
# define LOG(...) \
|
||||
if (LIKELY(do_logging)) { \
|
||||
GLenum _glerr = safeGLGetError(); \
|
||||
_LOG(__VA_ARGS__); \
|
||||
@ -107,13 +110,23 @@ void log_outputString(const char * const str);
|
||||
} //
|
||||
|
||||
// GL_MAYBELOG() only logs if an OpenGL error occurred
|
||||
#define GL_MAYBELOG(...) \
|
||||
# define GL_MAYBELOG(...) \
|
||||
if (LIKELY(do_logging)) { \
|
||||
GLenum _glerr = 0; \
|
||||
while ( (_glerr = safeGLGetError()) ) { \
|
||||
_LOG(__VA_ARGS__); \
|
||||
} \
|
||||
} //
|
||||
#endif
|
||||
|
||||
#define RELEASE_LOG(...) \
|
||||
if (LIKELY(do_logging)) { \
|
||||
GLenum _glerr = safeGLGetError(); \
|
||||
_LOG(__VA_ARGS__); \
|
||||
while ( (_glerr = safeGLGetError()) ) { \
|
||||
_LOG(__VA_ARGS__); \
|
||||
} \
|
||||
} //
|
||||
|
||||
#define QUIT_FUNCTION(x) exit(x)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user