Skip to content

Commit

Permalink
add/fix wincrossbuild 64
Browse files Browse the repository at this point in the history
  • Loading branch information
r-type committed Apr 21, 2017
1 parent e409236 commit b6190c7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cbus/scsicmd.c
Expand Up @@ -12,7 +12,7 @@
#include "scsicmd.h"
#include "fdd/sxsi.h"

#if defined(_WIN32) && defined(TRACE)
#if defined(_WIN32) && defined(TRACE) &&!defined(__LIBRETRO__)
extern void iptrace_out(void);
#define SCSICMD_ERR MessageBox(NULL, "SCSI error", "?", MB_OK); \
exit(1);
Expand Down
15 changes: 15 additions & 0 deletions libretro/Makefile.libretro
Expand Up @@ -171,6 +171,21 @@ else ifeq ($(platform), emscripten)
STATIC_LINKING = 1
COMMONFLAGS += -DEMSCRIPTEN

else ifeq ($(platform), wincross64)

AR = x86_64-w64-mingw32-ar
CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++
CFLAGS += -D__WIN32__ -DHAVE_SNPRINTF -DHAVE_VSNPRINTF -D__USE_MINGW_ANSI_STDIO=1 -DDEBUG_MAIN=1 -DDEBUG_CMDLINE=1 -DHAVE_NETWORK

# CFLAGS += -mno-ms-bitfields
# -DX64_WINDOWS_ABI
TARGET := $(TARGET_NAME)_libretro.dll
LDFLAGS += --shared -static-libgcc -static-libstdc++ -Wl,--version-script=link.T -L/usr/x86_64-w64-mingw32/lib

LDFLAGS += -lws2_32 -luser32 -lwinmm -ladvapi32 -lshlwapi -lwsock32 -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -lmingw32 -shared -lgcc -lm -lmingw32


else
CXXFLAGS += -mno-ms-bitfields
TARGET := $(TARGET_NAME)_libretro.dll
Expand Down
5 changes: 5 additions & 0 deletions libretro/compiler.h
Expand Up @@ -25,6 +25,11 @@
#define OSLANG_UTF8
#define OSLINEBREAK_CRLF
#define RESOURCE_US
#ifdef __WIN32__
#define sigjmp_buf jmp_buf
#define sigsetjmp(env, mask) setjmp(env)
#define siglongjmp(env, val) longjmp(env, val)
#endif

typedef int32_t SINT;
typedef uint32_t UINT;
Expand Down
5 changes: 4 additions & 1 deletion libretro/shim/dosio.c
Expand Up @@ -155,8 +155,11 @@ file_delete(const OEMCHAR *path)
short
file_dircreate(const OEMCHAR *path)
{

#if defined(WIN32)
return((short)mkdir(path));
#else
return (short)mkdir(path, 0777);
#endif
}


Expand Down
7 changes: 6 additions & 1 deletion libretro/shim/taskmng.c
Expand Up @@ -6,8 +6,9 @@
#include "menubase.h"
#include "sysmenu.h"

#ifndef _WIN32
#include "retro_miscellaneous.h"

#endif

BOOL task_avail;

Expand Down Expand Up @@ -108,7 +109,11 @@ BOOL taskmng_sleep(UINT32 tick) {
while((task_avail) && ((GETTICK() - base) < tick)) {
taskmng_rol();
//SDL_Delay(1);
#if defined(_WIN32)
Sleep(1);
#else
retro_sleep(1);
#endif
}
return(task_avail);
}
Expand Down

0 comments on commit b6190c7

Please sign in to comment.