Engine now builds under MSVC

This commit is contained in:
2023-02-16 22:05:48 +00:00
parent 57b545e517
commit b59bb18ce2
8 changed files with 378 additions and 14 deletions

View File

@@ -1,8 +1,5 @@
#pragma once
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
@@ -15,11 +12,17 @@
//platform/compiler-specific instructions
#if defined(__linux__) || defined(__MINGW32__) || defined(__GNUC__)
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <unistd.h>
#define BOX_API extern
#elif defined(_MSC_VER)
#include <SDL.h>
#include <SDL_image.h>
#include <windows.h>
#ifndef BOX_EXPORT
#define BOX_API __declspec(dllimport)
@@ -27,6 +30,8 @@
#define BOX_API __declspec(dllexport)
#endif
#define sleep Sleep
#else
#define BOX_API extern

View File

@@ -10,6 +10,8 @@
#include "lib_runner.h"
#include <stdio.h>
//errors here should be fatal
static void fatalError(char* message) {
fprintf(stderr, TOY_CC_ERROR "%s" TOY_CC_RESET, message);

View File

@@ -1,13 +1,14 @@
#pragma once
#include "toy_common.h"
#include "toy_interpreter.h"
int Toy_hookRunner(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Literal alias);
//file system API - these need to be set by the host
void Toy_initDriveDictionary();
void Toy_freeDriveDictionary();
Toy_LiteralDictionary* Toy_getDriveDictionary();
TOY_API void Toy_initDriveDictionary();
TOY_API void Toy_freeDriveDictionary();
TOY_API Toy_LiteralDictionary* Toy_getDriveDictionary();
#define TOY_OPAQUE_TAG_RUNNER 100