Fixed the rest of the build errors and warnings. Woo! Now for the manifests.

This commit is contained in:
Pietro Gagliardi 2019-04-21 17:28:47 -04:00
parent f7867f3427
commit b8b3b3df39
3 changed files with 16 additions and 1 deletions

View File

@ -1,4 +1,8 @@
// 19 april 2019 // 19 april 2019
// 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 <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

View File

@ -13,6 +13,13 @@ struct defer {
struct defer *next; struct defer *next;
}; };
#ifdef _MSC_VER
// Microsoft defines jmp_buf with a __declspec(align()), and for whatever reason, they have a warning that triggers when you use that for any reason, and that warning is enabled with /W4
// Silence the warning; it's harmless.
#pragma warning(push)
#pragma warning(disable: 4324)
#endif
struct testingT { struct testingT {
const char *name; const char *name;
void (*f)(testingT *); void (*f)(testingT *);
@ -26,6 +33,10 @@ struct testingT {
int defersRun; int defersRun;
}; };
#ifdef _MSC_VER
#pragma warning(pop)
#endif
static void initTest(testingT *t, const char *name, void (*f)(testingT *), const char *file, long line) static void initTest(testingT *t, const char *name, void (*f)(testingT *), const char *file, long line)
{ {
t->name = name; t->name = name;

View File

@ -18,7 +18,7 @@
#define testingprivMkCtor(basename, regfunc) \ #define testingprivMkCtor(basename, regfunc) \
__attribute__((constructor)) static void testingprivCtorName(basename)(void) { regfunc(#basename, testingprivScaffoldName(basename), __FILE__, __LINE__); } __attribute__((constructor)) static void testingprivCtorName(basename)(void) { regfunc(#basename, testingprivScaffoldName(basename), __FILE__, __LINE__); }
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define testingprivMkCtor(basename, reg) \ #define testingprivMkCtor(basename, regfunc) \
static int testingprivCtorName(basename)(void) { regfunc(#basename, testingprivScaffoldName(basename), __FILE__, __LINE__); return 0; } \ static int testingprivCtorName(basename)(void) { regfunc(#basename, testingprivScaffoldName(basename), __FILE__, __LINE__); return 0; } \
__pragma(section(".CRT$XCU",read)) \ __pragma(section(".CRT$XCU",read)) \
__declspec(allocate(".CRT$XCU")) static int (*testingprivCtorPtrName(basename))(void) = testingprivCtorName(basename); __declspec(allocate(".CRT$XCU")) static int (*testingprivCtorPtrName(basename))(void) = testingprivCtorName(basename);