changes for buildability under MSYS2 mingw32

This commit is contained in:
rakslice 2020-03-17 15:11:12 -07:00
parent 59ce931955
commit aeb585527d
6 changed files with 32 additions and 34 deletions

View File

@ -79,24 +79,33 @@ extern int my_errno;
// must hook all other functions that manipulate file names
#ifndef NO_POSIX_API_HOOK
#define stat my_stat
#define fstat my_fstat
#define open my_open
#define rename my_rename
#define access my_access
#define mkdir my_mkdir
#define remove my_remove
#define creat my_creat
#define close my_close
#define lseek my_lseek
#define read my_read
#define write my_write
#define ftruncate my_chsize
#define locking my_locking
#define utime my_utime
# ifdef stat
# undef stat
# endif
# define stat my_stat
# ifdef fstat
# undef fstat
# endif
# define fstat my_fstat
# define open my_open
# define rename my_rename
# define access my_access
# define mkdir my_mkdir
# define remove my_remove
# define creat my_creat
# define close my_close
# ifdef lseek
# undef lseek
# endif
# define lseek my_lseek
# define read my_read
# define write my_write
# define ftruncate my_chsize
# define locking my_locking
# define utime my_utime
#undef errno
#define errno my_errno
# undef errno
# define errno my_errno
#endif //!NO_POSIX_API_HOOK
#ifndef S_ISDIR
@ -125,6 +134,6 @@ struct my_utimbuf
};
// Your compiler may have different "struct stat" -> edit "struct my_stat"
#define validate_stat_struct ( sizeof(struct my_stat) == sizeof(struct stat) )
#define validate_stat_struct ( sizeof(struct my_stat) == sizeof(struct _stat) )
#define st_crtime st_ctime

View File

@ -23,6 +23,7 @@
#ifdef __MINGW32__
#define _UNICODE
#define UNICODE
#endif
#if !defined _MSC_VER && !defined __STDC__

View File

@ -32,21 +32,6 @@ typedef unsigned long ioctlsockopt_t;
# include <winsock2.h>
# include <WS2tcpip.h>
#ifdef __MINGW32__
char * WSAAPI inet_ntop(
INT Family,
PVOID pAddr,
PTSTR pStringBuf,
size_t StringBufSize
);
INT WSAAPI inet_pton(
INT Family,
const char * pszAddrString,
PVOID pAddrBuf
);
#endif
# include <sys/timeb.h>
# include <iphlpapi.h>

View File

@ -99,7 +99,7 @@ links:
case $$i in *codegen_x86.h) o=kpx_cpu/src/cpu/jit/x86/codegen_x86.h;; esac; \
SUB=`echo $$o | sed 's;[^/]*/;../;g' | sed 's;[^/]*$$;;'` ;\
cur_link=src/$$o ;\
if [ -d "$$cur_link" ]; then rm -rf "$$cur_link"; fi ;\
if [ -e "$$cur_link" ]; then rm -rf "$$cur_link"; fi ;\
ln -sf "$$PREFIX$$SUB$(B2_TOPDIR)/src/$$i" $$cur_link; \
fi; \
done;

View File

@ -76,6 +76,7 @@ SRCS = ../main.cpp main_windows.cpp ../prefs.cpp ../prefs_items.cpp prefs_window
UI_SRCS = ../prefs.cpp prefs_windows.cpp prefs_editor_gtk.cpp xpram_windows.cpp \
../prefs_items.cpp ../user_strings.cpp user_strings_windows.cpp util_windows.cpp \
../dummy/prefs_dummy.cpp \
b2ether/packet32.cpp SheepShaverGUI.rc
UI_APP = SheepShaverGUI.exe

View File

@ -41,7 +41,9 @@
#undef _TEXT
#include <time.h>
#ifdef __WIN32__
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <WinSock2.h>
#endif
#include <sys/types.h>