Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ set(uvwasi_sources
src/wasi_rights.c
)

option(UVWASI_DEBUG_LOG "Enable debug logging" OFF)
if(UVWASI_DEBUG_LOG)
list(APPEND uvwasi_cflags -DUVWASI_DEBUG_LOG)
endif()

# Code Coverage Configuration
add_library(coverage_config INTERFACE)

Expand Down
13 changes: 13 additions & 0 deletions src/debug.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef __UVWASI_DEBUG_H__
#define __UVWASI_DEBUG_H__

#ifdef UVWASI_DEBUG_LOG
# define __STDC_FORMAT_MACROS
# include <inttypes.h>
# define DEBUG(fmt, ...) \
do { fprintf(stderr, fmt, __VA_ARGS__); } while (0)
#else
# define DEBUG(fmt, ...)
#endif

#endif /* __UVWASI_DEBUG_H__ */
Loading