From 6039a60549dd7ef815115417c1ada3aa52bc50d3 Mon Sep 17 00:00:00 2001 From: kanjitalk755 Date: Wed, 20 Jun 2018 21:26:11 +0900 Subject: [PATCH] fix merge error --- BasiliskII/src/SDL/video_sdl.cpp | 2 +- BasiliskII/src/Windows/main_windows.cpp | 40 ++------ BasiliskII/src/slirp/slirp.h | 116 +++++++++++++++--------- 3 files changed, 79 insertions(+), 79 deletions(-) mode change 100644 => 100755 BasiliskII/src/slirp/slirp.h diff --git a/BasiliskII/src/SDL/video_sdl.cpp b/BasiliskII/src/SDL/video_sdl.cpp index d8bd40ff..7bc43fe2 100644 --- a/BasiliskII/src/SDL/video_sdl.cpp +++ b/BasiliskII/src/SDL/video_sdl.cpp @@ -2235,7 +2235,7 @@ static int redraw_func(void *arg) // Wait next += VIDEO_REFRESH_DELAY; - uint64 delay = int32(next - GetTicks_usec()); + int32 delay = int32(next - GetTicks_usec()); if (delay > 0) Delay_usec(delay); else if (delay < -VIDEO_REFRESH_DELAY) diff --git a/BasiliskII/src/Windows/main_windows.cpp b/BasiliskII/src/Windows/main_windows.cpp index 2629c4b7..184a2dc6 100755 --- a/BasiliskII/src/Windows/main_windows.cpp +++ b/BasiliskII/src/Windows/main_windows.cpp @@ -212,26 +212,6 @@ int main(int argc, char **argv) char str[256]; bool cd_boot = false; - // Redirect stdout and stderr to a log file, for diagnostic purposes. - // Unbuffered file IO will be used (setup via setvbuf() calls), so as - // to write log file data ASAP, lest it get lost in case of program - // termination. - wchar_t logFileName[4096]; - logFileName[0] = L'\0'; - _wgetcwd(logFileName, SDL_arraysize(logFileName)); - if (logFileName[0] != L'\0') { - SDL_wcslcat(logFileName, L"\\BasiliskII_log.txt", SDL_arraysize(logFileName)); - FILE * fp; - fp = _wfreopen(logFileName, L"w", stdout); - if (fp) { - setvbuf(stdout, NULL, _IONBF, 0); - } - fp = _wfreopen(logFileName, L"w", stderr); - if (fp) { - setvbuf(stderr, NULL, _IONBF, 0); - } - } - // Initialize variables RAMBaseHost = NULL; ROMBaseHost = NULL; @@ -303,6 +283,10 @@ int main(int argc, char **argv) QuitEmulator(); #endif + // FIXME: default to DIB driver + if (getenv("SDL_VIDEODRIVER") == NULL) + putenv("SDL_VIDEODRIVER=windib"); + // Initialize SDL system int sdl_flags = 0; #ifdef USE_SDL_VIDEO @@ -416,7 +400,7 @@ int main(int argc, char **argv) emul_thread = GetCurrentThread(); // SDL threads available, start 60Hz thread - tick_thread_active = ((tick_thread = SDL_CreateThread(tick_func, "Redraw Thread", NULL)) != NULL); + tick_thread_active = ((tick_thread = SDL_CreateThread(tick_func, NULL)) != NULL); if (!tick_thread_active) { sprintf(str, GetString(STR_TICK_THREAD_ERR), strerror(errno)); ErrorAlert(str); @@ -426,7 +410,7 @@ int main(int argc, char **argv) // Start XPRAM watchdog thread memcpy(last_xpram, XPRAM, XPRAM_SIZE); - xpram_thread_active = ((xpram_thread = SDL_CreateThread(xpram_func, "XPRAM Thread", NULL)) != NULL); + xpram_thread_active = ((xpram_thread = SDL_CreateThread(xpram_func, NULL)) != NULL); D(bug("XPRAM thread started\n")); // Start 68k and jump to ROM boot routine @@ -641,21 +625,11 @@ static int tick_func(void *arg) #ifdef USE_SDL_VIDEO #include -extern SDL_Window *sdl_window; HWND GetMainWindowHandle(void) { SDL_SysWMinfo wmInfo; SDL_VERSION(&wmInfo.version); - if (!sdl_window) { - return NULL; - } - if (!SDL_GetWindowWMInfo(sdl_window, &wmInfo)) { - return NULL; - } - if (wmInfo.subsystem != SDL_SYSWM_WINDOWS) { - return NULL; - } - return wmInfo.info.win.window; + return SDL_GetWMInfo(&wmInfo) ? wmInfo.window : NULL; } #endif diff --git a/BasiliskII/src/slirp/slirp.h b/BasiliskII/src/slirp/slirp.h old mode 100644 new mode 100755 index 81a49dd2..3f9428af --- a/BasiliskII/src/slirp/slirp.h +++ b/BasiliskII/src/slirp/slirp.h @@ -28,6 +28,7 @@ typedef unsigned long ioctlsockopt_t; #define _WIN32_WINNT 0x501 #endif #endif +//# include # include # include @@ -50,6 +51,12 @@ INT WSAAPI inet_pton( # include # define USE_FIONBIO 1 +# define EWOULDBLOCK WSAEWOULDBLOCK +# define EINPROGRESS WSAEINPROGRESS +# define ENOTCONN WSAENOTCONN +# define EHOSTUNREACH WSAEHOSTUNREACH +# define ENETUNREACH WSAENETUNREACH +# define ECONNREFUSED WSAECONNREFUSED /* Basilisk II Router defines those */ # define udp_read_completion slirp_udp_read_completion @@ -155,23 +162,32 @@ typedef u_int32_t uint32; #include #endif +#ifndef _P +#ifndef NO_PROTOTYPES +# define _P(x) x +#else +# define _P(x) () +#endif +#endif + + #ifdef GETTIMEOFDAY_ONE_ARG #define gettimeofday(x, y) gettimeofday(x) #endif /* Systems lacking strdup() definition in . */ #if defined(ultrix) -char *strdup(const char *); +char *strdup _P((const char *)); #endif /* Systems lacking malloc() definition in . */ #if defined(ultrix) || defined(hcx) -void *malloc(size_t arg); -void free(void *ptr); +void *malloc _P((size_t arg)); +void free _P((void *ptr)); #endif #ifndef HAVE_INET_ATON -int inet_aton(const char *cp, struct in_addr *ia); +int inet_aton _P((const char *cp, struct in_addr *ia)); #endif #include @@ -209,7 +225,11 @@ int inet_aton(const char *cp, struct in_addr *ia); #include #endif +#ifdef __STDC__ #include +#else +#include +#endif #include @@ -268,38 +288,38 @@ extern struct ttys *ttys_unit[MAX_INTERFACES]; #endif #ifndef FULL_BOLT -void if_start(void); +void if_start _P((void)); #else -void if_start(struct ttys *); +void if_start _P((struct ttys *)); #endif #ifdef BAD_SPRINTF # define vsprintf vsprintf_len # define sprintf sprintf_len - extern int vsprintf_len(char *, const char *, va_list); - extern int sprintf_len(char *, const char *, ...); + extern int vsprintf_len _P((char *, const char *, va_list)); + extern int sprintf_len _P((char *, const char *, ...)); #endif #ifdef DECLARE_SPRINTF # ifndef BAD_SPRINTF - extern int vsprintf(char *, const char *, va_list); + extern int vsprintf _P((char *, const char *, va_list)); # endif - extern int vfprintf(FILE *, const char *, va_list); + extern int vfprintf _P((FILE *, const char *, va_list)); #endif #ifndef HAVE_STRERROR - extern char *strerror(int error); + extern char *strerror _P((int error)); #endif #ifndef HAVE_INDEX - char *index(const char *, int); + char *index _P((const char *, int)); #endif #ifndef HAVE_GETHOSTID - long gethostid(void); + long gethostid _P((void)); #endif -void lprint(const char *, ...); +void lprint _P((const char *, ...)); extern int do_echo; @@ -321,47 +341,48 @@ extern int do_echo; int cksum(struct mbuf *m, int len); /* if.c */ -void if_init(void); -void if_output(struct socket *, struct mbuf *); +void if_init _P((void)); +void if_output _P((struct socket *, struct mbuf *)); /* ip_input.c */ -void ip_init(void); -void ip_input(struct mbuf *); -struct ip * ip_reass(register struct ipasfrag *, register struct ipq *); -void ip_freef(struct ipq *); -void ip_enq(register struct ipasfrag *, register struct ipasfrag *); -void ip_deq(register struct ipasfrag *); -void ip_slowtimo(void); -void ip_stripoptions(register struct mbuf *, struct mbuf *); +void ip_init _P((void)); +void ip_input _P((struct mbuf *)); +static struct ip * +ip_reass(register struct ip *ip, register struct ipq *); +void ip_freef _P((struct ipq *)); +void ip_enq _P((register struct ipasfrag *, register struct ipasfrag *)); +void ip_deq _P((register struct ipasfrag *)); +void ip_slowtimo _P((void)); +void ip_stripoptions _P((register struct mbuf *, struct mbuf *)); /* ip_output.c */ -int ip_output(struct socket *, struct mbuf *); +int ip_output _P((struct socket *, struct mbuf *)); /* tcp_input.c */ -int tcp_reass(register struct tcpcb *, register struct tcpiphdr *, struct mbuf *); -void tcp_input(register struct mbuf *, int, struct socket *); -void tcp_dooptions(struct tcpcb *, u_char *, int, struct tcpiphdr *); -void tcp_xmit_timer(register struct tcpcb *, int); -u_int tcp_mss(register struct tcpcb *, u_int); +int tcp_reass _P((register struct tcpcb *, register struct tcpiphdr *, struct mbuf *)); +void tcp_input _P((register struct mbuf *, int, struct socket *)); +void tcp_dooptions _P((struct tcpcb *, u_char *, int, struct tcpiphdr *)); +void tcp_xmit_timer _P((register struct tcpcb *, int)); +int tcp_mss _P((register struct tcpcb *, u_int)); /* tcp_output.c */ -int tcp_output(register struct tcpcb *); -void tcp_setpersist(register struct tcpcb *); +int tcp_output _P((register struct tcpcb *)); +void tcp_setpersist _P((register struct tcpcb *)); /* tcp_subr.c */ -void tcp_init(void); -void tcp_template(struct tcpcb *); -void tcp_respond(struct tcpcb *, register struct tcpiphdr *, register struct mbuf *, tcp_seq, tcp_seq, int); -struct tcpcb * tcp_newtcpcb(struct socket *); -struct tcpcb * tcp_close(register struct tcpcb *); -void tcp_drain(void); -void tcp_sockclosed(struct tcpcb *); -int tcp_fconnect(struct socket *); -void tcp_connect(struct socket *); -int tcp_attach(struct socket *); -u_int8_t tcp_tos(struct socket *); -int tcp_emu(struct socket *, struct mbuf *); -int tcp_ctl(struct socket *); +void tcp_init _P((void)); +void tcp_template _P((struct tcpcb *)); +void tcp_respond _P((struct tcpcb *, register struct tcpiphdr *, register struct mbuf *, tcp_seq, tcp_seq, int)); +struct tcpcb * tcp_newtcpcb _P((struct socket *)); +struct tcpcb * tcp_close _P((register struct tcpcb *)); +void tcp_drain _P((void)); +void tcp_sockclosed _P((struct tcpcb *)); +int tcp_fconnect _P((struct socket *)); +void tcp_connect _P((struct socket *)); +int tcp_attach _P((struct socket *)); +u_int8_t tcp_tos _P((struct socket *)); +int tcp_emu _P((struct socket *, struct mbuf *)); +int tcp_ctl _P((struct socket *)); struct tcpcb *tcp_drop(struct tcpcb *tp, int err); #ifdef USE_PPP @@ -377,4 +398,9 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err); #define max(x,y) ((x) > (y) ? (x) : (y)) #endif +#ifdef _WIN32 +#undef errno +#define errno (WSAGetLastError()) +#endif + #endif