launcher, launchctl: ensure that they build under all platforms/configurations

This commit is contained in:
Bill Zissimopoulos
2016-05-15 11:22:19 -07:00
parent c1985bef6c
commit 9971472be7
2 changed files with 10 additions and 8 deletions

View File

@ -19,11 +19,11 @@
#define PROGNAME "launchctl"
#define info(format, ...) log(GetStdHandle(STD_OUTPUT_HANDLE), format, __VA_ARGS__)
#define warn(format, ...) log(GetStdHandle(STD_ERROR_HANDLE), format, __VA_ARGS__)
#define info(format, ...) printlog(GetStdHandle(STD_OUTPUT_HANDLE), format, __VA_ARGS__)
#define warn(format, ...) printlog(GetStdHandle(STD_ERROR_HANDLE), format, __VA_ARGS__)
#define fatal(ExitCode, format, ...) (warn(format, __VA_ARGS__), ExitProcess(ExitCode))
static void vlog(HANDLE h, const char *format, va_list ap)
static void vprintlog(HANDLE h, const char *format, va_list ap)
{
char buf[1024];
/* wvsprintf is only safe with a 1024 byte buffer */
@ -39,12 +39,12 @@ static void vlog(HANDLE h, const char *format, va_list ap)
WriteFile(h, buf, (DWORD)len, &BytesTransferred, 0);
}
static void log(HANDLE h, const char *format, ...)
static void printlog(HANDLE h, const char *format, ...)
{
va_list ap;
va_start(ap, format);
vlog(h, format, ap);
vprintlog(h, format, ap);
va_end(ap);
}