Better way to detect mingw-w64; fix bettercamera for mingw.org; close

.assets-local.txt before deleting it.
This commit is contained in:
yksoft1 2020-05-15 00:26:56 +08:00
parent fa9af3227e
commit 1b03e251bb
5 changed files with 17 additions and 4 deletions

View file

@ -47,6 +47,7 @@ def remove_file(fname):
def clean_assets(local_asset_file): def clean_assets(local_asset_file):
assets = set(read_asset_map().keys()) assets = set(read_asset_map().keys())
assets.update(read_local_asset_list(local_asset_file)) assets.update(read_local_asset_list(local_asset_file))
local_asset_file.close()
for fname in list(assets) + [".assets-local.txt"]: for fname in list(assets) + [".assets-local.txt"]:
if fname.startswith("@"): if fname.startswith("@"):
continue continue

View file

@ -38,11 +38,14 @@ typedef s32 ptrdiff_t;
#else #else
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) #if defined(__MINGW32__)
#include <_mingw.h>
#if !defined(__MINGW64_VERSION_MAJOR)
typedef long ssize_t; typedef long ssize_t;
#else #else
typedef ptrdiff_t ssize_t; typedef ptrdiff_t ssize_t;
#endif #endif
#endif #endif
#endif
#endif #endif

View file

@ -30,10 +30,13 @@
#include <PR/libaudio.h> #include <PR/libaudio.h>
#include <PR/libultra.h> #include <PR/libultra.h>
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) #if defined(__MINGW32__)
#include <_mingw.h>
#if !defined(__MINGW64_VERSION_MAJOR)
#include <string.h> #include <string.h>
#define bzero(b,len) (memset((b), '\0', (len)), (void) 0) #define bzero(b,len) (memset((b), '\0', (len)), (void) 0)
#define bcopy(s1, s2, n) memmove((s2), (s1), (n)) #define bcopy(s1, s2, n) memmove((s2), (s1), (n))
#endif #endif
#endif
#endif #endif

View file

@ -9,8 +9,11 @@
#include "include/text_strings.h" #include "include/text_strings.h"
#include "engine/surface_collision.h" #include "engine/surface_collision.h"
#include "pc/configfile.h" #include "pc/configfile.h"
#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
//quick and dirty fix for some older MinGW.org mingwrt
#else
#include <stdio.h> #include <stdio.h>
#endif
/** /**

View file

@ -153,7 +153,9 @@ static size_t buf_vbo_num_tris;
static struct GfxWindowManagerAPI *gfx_wapi; static struct GfxWindowManagerAPI *gfx_wapi;
static struct GfxRenderingAPI *gfx_rapi; static struct GfxRenderingAPI *gfx_rapi;
#if defined(_WIN32) && !defined(__MINGW64_VERSION_MAJOR) #if defined(__MINGW32__)
#include <_mingw.h>
#if !defined(__MINGW64_VERSION_MAJOR)
#include <windows.h> #include <windows.h>
#define CLOCK_MONOTONIC 0 #define CLOCK_MONOTONIC 0
//https://stackoverflow.com/questions/5404277/porting-clock-gettime-to-windows //https://stackoverflow.com/questions/5404277/porting-clock-gettime-to-windows
@ -168,6 +170,7 @@ int clock_gettime(int arg, struct timespec *spec) //C-file part
#else #else
#include <time.h> #include <time.h>
#endif #endif
#endif
static unsigned long get_time(void) { static unsigned long get_time(void) {
struct timespec ts; struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts); clock_gettime(CLOCK_MONOTONIC, &ts);