Skip to content

Commit

Permalink
make debug messages optional for debug build
Browse files Browse the repository at this point in the history
  • Loading branch information
Unesty committed Nov 7, 2020
1 parent 1380948 commit 8475741
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/swvkc.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,11 +599,9 @@ void input_key_notify(struct aaa *e, void *user_data) {
}
struct surface_node *match;
if( e->key == KEY_TAB) {
write(2,"tab\n",4);
match = wl_container_of(server->mapped_surfaces_list.next->next, match, link);
errlog("match %p", (void*)match);
if(server->mapped_surfaces_list.next->prev!=server->mapped_surfaces_list.next->next) {
write(2,"exist\n",6);
server_change_focus(server, match);
}
break;
Expand Down
5 changes: 5 additions & 0 deletions subprojects/libswvkc-wl/include/util/log.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#ifndef MY_LOG_H
#define MY_LOG_H

#ifdef NDEBUG
void errlog(const char *fmt, ...);
void boxlog(const char *fmt, ...);
#else
void errlog(const char *fmt, ...);
void boxlog(const char *fmt, ...);
#endif

#endif
6 changes: 3 additions & 3 deletions subprojects/libswvkc-wl/util/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stdio.h>
#include <time.h>

#if !defined NDEBUG
#if defined NDEBUG
void errlog(const char *fmt, ...) {
va_list args;
va_start(args, fmt);
Expand All @@ -29,6 +29,6 @@ void boxlog(const char *fmt, ...) {
va_end(args);
}
#else
#define errlog(...);
#define boxlog(...);
void errlog(const char *fmt, ...) {}
void boxlog(const char *fmt, ...) {}
#endif

0 comments on commit 8475741

Please sign in to comment.