Fixed build errors on Windows.
This commit is contained in:
parent
98093ed46e
commit
ee3e587ddc
|
@ -4,8 +4,6 @@
|
|||
#include "lib/thread.h"
|
||||
#include "test.h"
|
||||
|
||||
// TODO fix up the formatting of testing.c so we can use newlines on the got/want stuff
|
||||
|
||||
#define errInvalidOptions "options parameter to uiInit() must be NULL"
|
||||
#define errAlreadyInitialized "libui already initialized"
|
||||
|
||||
|
|
|
@ -22,15 +22,7 @@ libui_test_deps += [
|
|||
required: true),
|
||||
]
|
||||
if libui_OS == 'windows'
|
||||
libui_test_manifest = 'test.manifest'
|
||||
if libui_mode == 'static'
|
||||
libui_test_manifest = 'test.static.manifest'
|
||||
endif
|
||||
libui_test_sources += [
|
||||
windows.compile_resources('resources.rc',
|
||||
args: libui_manifest_args,
|
||||
depend_files: [libui_test_manifest]),
|
||||
]
|
||||
# static mode already gives us these dependencies
|
||||
if libui_mode != 'static'
|
||||
libui_test_deps += [
|
||||
meson.get_compiler('c').find_library('kernel32',
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
// 27 february 2018
|
||||
// TODO get rid of the need for this (it temporarily silences noise so I can find actual build issues)
|
||||
#ifdef _MSC_VER
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <setjmp.h>
|
||||
|
@ -6,6 +10,14 @@
|
|||
#include "timer.h"
|
||||
#include "testing.h"
|
||||
|
||||
// goddamnit VS2013
|
||||
#ifdef _MSC_VER
|
||||
#define testingprivSnprintf _snprintf
|
||||
#else
|
||||
#define testingprivSnprint snprintf
|
||||
#endif
|
||||
// and yes, vsnprintf() IS properly provided, so wtf
|
||||
|
||||
void testingprivInternalError(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -297,14 +309,14 @@ void testingprivTLogvfFull(testingT *t, const char *file, long line, const char
|
|||
int n, n2;
|
||||
|
||||
// TODO extract filename from file
|
||||
n = snprintf(NULL, 0, "%s:%ld: ", file, line);
|
||||
n = testingprivSnprintf(NULL, 0, "%s:%ld: ", file, line);
|
||||
// TODO handle n < 0 case
|
||||
va_copy(ap2, ap);
|
||||
n2 = vsnprintf(NULL, 0, format, ap2);
|
||||
// TODO handle n2 < 0 case
|
||||
va_end(ap2);
|
||||
buf = testingprivNewArray(char, n + n2 + 1);
|
||||
snprintf(buf, n + 1, "%s:%ld: ", file, line);
|
||||
testingprivSnprintf(buf, n + 1, "%s:%ld: ", file, line);
|
||||
vsnprintf(buf + n, n2 + 1, format, ap);
|
||||
printfIndented(t->indent, "%s", buf);
|
||||
testingprivFree(buf);
|
||||
|
|
|
@ -5,6 +5,18 @@ libui_test_sources = [
|
|||
'main.c',
|
||||
]
|
||||
|
||||
if libui_OS == 'windows'
|
||||
libui_test_manifest = 'test.manifest'
|
||||
if libui_mode == 'static'
|
||||
libui_test_manifest = 'test.static.manifest'
|
||||
endif
|
||||
libui_test_sources += [
|
||||
windows.compile_resources('resources.rc',
|
||||
args: libui_manifest_args,
|
||||
depend_files: [libui_test_manifest]),
|
||||
]
|
||||
endif
|
||||
|
||||
libui_test_deps = []
|
||||
|
||||
subdir('lib')
|
||||
|
|
Loading…
Reference in New Issue