nodejs / uvwasi

WASI syscall API built atop libuv
MIT License
225 stars 49 forks source link

Add support for single argument UVWASI_DEBUG #178

Closed danbev closed 1 year ago

danbev commented 1 year ago

This commit updates the UVWASI_DEBUG macro to accept a single format argument, one without any format specifiers in it and hence no following arguments. For example:

    UVWASI_DEBUG("some log message...\n");

This will currently result in the following compiler error:

/uvwasi/src/uvwasi.c: In function ‘uvwasi_fd_readdir’: /uvwasi/src/debug.h:10:42: error:
expected expression before ‘)’ token
   10 |     do { fprintf(stderr, fmt, __VA_ARGS__); } while (0)
      |                                          ^
/uvwasi/src/uvwasi.c:1303:3: note: in expansion of macro ‘UVWASI_DEBUG’
 1303 |   UVWASI_DEBUG("some log message...\n");

This change in this commit allows the above kind of log statements.