diff --git a/extract_assets.py b/extract_assets.py index 706fc728..7c29358b 100755 --- a/extract_assets.py +++ b/extract_assets.py @@ -47,6 +47,7 @@ def remove_file(fname): def clean_assets(local_asset_file): assets = set(read_asset_map().keys()) assets.update(read_local_asset_list(local_asset_file)) + local_asset_file.close() for fname in list(assets) + [".assets-local.txt"]: if fname.startswith("@"): continue diff --git a/include/PR/ultratypes.h b/include/PR/ultratypes.h index 8d590542..62f14f31 100644 --- a/include/PR/ultratypes.h +++ b/include/PR/ultratypes.h @@ -38,11 +38,14 @@ typedef s32 ptrdiff_t; #else #include #include -#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) +#if defined(__MINGW32__) +#include <_mingw.h> +#if !defined(__MINGW64_VERSION_MAJOR) typedef long ssize_t; #else typedef ptrdiff_t ssize_t; #endif #endif +#endif #endif diff --git a/include/ultra64.h b/include/ultra64.h index 94bbc388..e78ded49 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -30,10 +30,13 @@ #include #include -#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) +#if defined(__MINGW32__) +#include <_mingw.h> +#if !defined(__MINGW64_VERSION_MAJOR) #include #define bzero(b,len) (memset((b), '\0', (len)), (void) 0) #define bcopy(s1, s2, n) memmove((s2), (s1), (n)) #endif +#endif #endif diff --git a/src/game/bettercamera.inc.h b/src/game/bettercamera.inc.h index 6c9592b8..b48f5d4c 100644 --- a/src/game/bettercamera.inc.h +++ b/src/game/bettercamera.inc.h @@ -9,8 +9,11 @@ #include "include/text_strings.h" #include "engine/surface_collision.h" #include "pc/configfile.h" +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) +//quick and dirty fix for some older MinGW.org mingwrt +#else #include - +#endif /** diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c index 72147886..570c5305 100644 --- a/src/pc/gfx/gfx_pc.c +++ b/src/pc/gfx/gfx_pc.c @@ -153,7 +153,9 @@ static size_t buf_vbo_num_tris; static struct GfxWindowManagerAPI *gfx_wapi; static struct GfxRenderingAPI *gfx_rapi; -#if defined(_WIN32) && !defined(__MINGW64_VERSION_MAJOR) +#if defined(__MINGW32__) +#include <_mingw.h> +#if !defined(__MINGW64_VERSION_MAJOR) #include #define CLOCK_MONOTONIC 0 //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 #include #endif +#endif static unsigned long get_time(void) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);