Removed more spurious Windows.h #includes.

MSVC-compatible use of #pragma pack.
Fixed potential crash in Sys_open.
Use MSVC intrinsics for byte swapping.
Ensure use of winsock2 (instead of winsock).
Set appropriate architecture #defines.
Fixed various other compile warnings/errors.
This commit is contained in:
James Touton 2015-08-06 02:31:42 -07:00
parent 9b8238ee3e
commit 47e95ba2e6
11 changed files with 81 additions and 68 deletions

View File

@ -23,6 +23,8 @@
#define MAXIMUM_NUMBER_TRACKS 100 #define MAXIMUM_NUMBER_TRACKS 100
#define MAXIMUM_CDROM_SIZE 804 #define MAXIMUM_CDROM_SIZE 804
#pragma pack(push, 1)
typedef struct _TRACK_DATA { typedef struct _TRACK_DATA {
UCHAR Reserved; UCHAR Reserved;
UCHAR Control : 4; UCHAR Control : 4;
@ -30,14 +32,14 @@ typedef struct _TRACK_DATA {
UCHAR TrackNumber; UCHAR TrackNumber;
UCHAR Reserved1; UCHAR Reserved1;
UCHAR Address[4]; UCHAR Address[4];
} ATTRIBUTE_PACKED TRACK_DATA, *PTRACK_DATA; } TRACK_DATA, *PTRACK_DATA;
typedef struct _CDROM_TOC { typedef struct _CDROM_TOC {
UCHAR Length[2]; UCHAR Length[2];
UCHAR FirstTrack; UCHAR FirstTrack;
UCHAR LastTrack; UCHAR LastTrack;
TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS]; TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
} ATTRIBUTE_PACKED CDROM_TOC, *PCDROM_TOC; } CDROM_TOC, *PCDROM_TOC;
// #include "ntddcdrm.h" // #include "ntddcdrm.h"
#define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM #define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
@ -61,7 +63,7 @@ typedef struct _CDROM_TOC {
typedef struct _VOLUME_CONTROL { typedef struct _VOLUME_CONTROL {
UCHAR PortVolume[4]; UCHAR PortVolume[4];
} ATTRIBUTE_PACKED VOLUME_CONTROL, *PVOLUME_CONTROL; } VOLUME_CONTROL, *PVOLUME_CONTROL;
typedef struct _CDROM_PLAY_AUDIO_MSF { typedef struct _CDROM_PLAY_AUDIO_MSF {
UCHAR StartingM; UCHAR StartingM;
@ -70,13 +72,13 @@ typedef struct _CDROM_PLAY_AUDIO_MSF {
UCHAR EndingM; UCHAR EndingM;
UCHAR EndingS; UCHAR EndingS;
UCHAR EndingF; UCHAR EndingF;
} ATTRIBUTE_PACKED CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF; } CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF;
typedef struct _CDROM_SEEK_AUDIO_MSF { typedef struct _CDROM_SEEK_AUDIO_MSF {
UCHAR M; UCHAR M;
UCHAR S; UCHAR S;
UCHAR F; UCHAR F;
} ATTRIBUTE_PACKED CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF; } CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
// //
@ -87,7 +89,7 @@ typedef struct _SUB_Q_HEADER {
UCHAR Reserved; UCHAR Reserved;
UCHAR AudioStatus; UCHAR AudioStatus;
UCHAR DataLength[2]; UCHAR DataLength[2];
} ATTRIBUTE_PACKED SUB_Q_HEADER, *PSUB_Q_HEADER; } SUB_Q_HEADER, *PSUB_Q_HEADER;
typedef struct _SUB_Q_CURRENT_POSITION { typedef struct _SUB_Q_CURRENT_POSITION {
SUB_Q_HEADER Header; SUB_Q_HEADER Header;
@ -98,7 +100,7 @@ typedef struct _SUB_Q_CURRENT_POSITION {
UCHAR IndexNumber; UCHAR IndexNumber;
UCHAR AbsoluteAddress[4]; UCHAR AbsoluteAddress[4];
UCHAR TrackRelativeAddress[4]; UCHAR TrackRelativeAddress[4];
} ATTRIBUTE_PACKED SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION; } SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER { typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
SUB_Q_HEADER Header; SUB_Q_HEADER Header;
@ -107,7 +109,7 @@ typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
UCHAR Reserved1 : 7; UCHAR Reserved1 : 7;
UCHAR Mcval : 1; UCHAR Mcval : 1;
UCHAR MediaCatalog[15]; UCHAR MediaCatalog[15];
} ATTRIBUTE_PACKED SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER; } SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
typedef struct _SUB_Q_TRACK_ISRC { typedef struct _SUB_Q_TRACK_ISRC {
SUB_Q_HEADER Header; SUB_Q_HEADER Header;
@ -118,7 +120,7 @@ typedef struct _SUB_Q_TRACK_ISRC {
UCHAR Reserved2 : 7; UCHAR Reserved2 : 7;
UCHAR Tcval : 1; UCHAR Tcval : 1;
UCHAR TrackIsrc[15]; UCHAR TrackIsrc[15];
} ATTRIBUTE_PACKED SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC; } SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
typedef union _SUB_Q_CHANNEL_DATA { typedef union _SUB_Q_CHANNEL_DATA {
SUB_Q_CURRENT_POSITION CurrentPosition; SUB_Q_CURRENT_POSITION CurrentPosition;
@ -136,16 +138,16 @@ typedef struct __RAW_READ_INFO {
LARGE_INTEGER DiskOffset; LARGE_INTEGER DiskOffset;
ULONG SectorCount; ULONG SectorCount;
TRACK_MODE_TYPE TrackMode; TRACK_MODE_TYPE TrackMode;
} ATTRIBUTE_PACKED RAW_READ_INFO, *PRAW_READ_INFO; } RAW_READ_INFO, *PRAW_READ_INFO;
typedef struct _CDROM_SUB_Q_DATA_FORMAT { typedef struct _CDROM_SUB_Q_DATA_FORMAT {
UCHAR Format; UCHAR Format;
UCHAR Track; UCHAR Track;
} ATTRIBUTE_PACKED CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT; } CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
#define IOCTL_CDROM_SUB_Q_CHANNEL 0x00 #define IOCTL_CDROM_SUB_Q_CHANNEL 0x00
#define IOCTL_CDROM_CURRENT_POSITION 0x01 #define IOCTL_CDROM_CURRENT_POSITION 0x01
#define IOCTL_CDROM_MEDIA_CATALOG 0x02 #define IOCTL_CDROM_MEDIA_CATALOG 0x02
#define IOCTL_CDROM_TRACK_ISRC 0x03 #define IOCTL_CDROM_TRACK_ISRC 0x03
#pragma pack() #pragma pack(pop)

View File

@ -21,8 +21,6 @@
#include "sysdeps.h" #include "sysdeps.h"
#include <vector> #include <vector>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "macos_util.h" #include "macos_util.h"
#include "clip.h" #include "clip.h"
@ -236,7 +234,7 @@ static void do_getscrap(void **handle, uint32 type, int32 offset)
// Convert text from ISO-Latin1 to Mac charset // Convert text from ISO-Latin1 to Mac charset
uint8 *p = Mac2HostAddr(scrap_area); uint8 *p = Mac2HostAddr(scrap_area);
for (int i = 0; i < length; i++) { for (uint32 i = 0; i < length; i++) {
uint8 c = data[i]; uint8 c = data[i];
if (c < 0x80) { if (c < 0x80) {
if (c == 0) if (c == 0)
@ -262,7 +260,7 @@ static void do_getscrap(void **handle, uint32 type, int32 offset)
0x2f, 0x3c, 0, 0, 0, 0, // move.l #outbuf,-(sp) 0x2f, 0x3c, 0, 0, 0, 0, // move.l #outbuf,-(sp)
0xa9, 0xfe, // PutScrap() 0xa9, 0xfe, // PutScrap()
0x58, 0x8f, // addq.l #4,sp 0x58, 0x8f, // addq.l #4,sp
M68K_RTS >> 8, M68K_RTS uint8(M68K_RTS >> 8), uint8(M68K_RTS)
}; };
uint32 proc_area = Host2MacAddr(proc); uint32 proc_area = Host2MacAddr(proc);
WriteMacInt32(proc_area + 6, out_length); WriteMacInt32(proc_area + 6, out_length);

View File

@ -20,9 +20,6 @@
#include "sysdeps.h" #include "sysdeps.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -23,7 +23,7 @@
#ifndef _ROUTER_TYPES_H_ #ifndef _ROUTER_TYPES_H_
#define _ROUTER_TYPES_H_ #define _ROUTER_TYPES_H_
#pragma pack(1) #pragma pack(push, 1)
// --------------------------- MAC --------------------------- // --------------------------- MAC ---------------------------
@ -31,7 +31,7 @@ typedef struct {
uint8 dest[6]; uint8 dest[6];
uint8 src[6]; uint8 src[6];
uint16 type; uint16 type;
} ATTRIBUTE_PACKED mac_t; } mac_t;
enum { enum {
mac_type_llc_ipx_limit = 0x05DC, // <= mac_type_llc_ipx_limit -->> 802.3 MAC frame mac_type_llc_ipx_limit = 0x05DC, // <= mac_type_llc_ipx_limit -->> 802.3 MAC frame
@ -54,7 +54,7 @@ typedef struct {
uint8 srcp[4]; // size for ip uint8 srcp[4]; // size for ip
uint8 dsth[6]; // size for ethernet uint8 dsth[6]; // size for ethernet
uint8 dstp[4]; // size for ip uint8 dstp[4]; // size for ip
} ATTRIBUTE_PACKED arp_t; } arp_t;
enum { enum {
arp_request = 1, arp_request = 1,
@ -79,7 +79,7 @@ typedef struct {
uint32 src; uint32 src;
uint32 dest; uint32 dest;
// ip options, size = 4 * header_len - 20 // ip options, size = 4 * header_len - 20
} ATTRIBUTE_PACKED ip_t; } ip_t;
// Protocol STD numbers // Protocol STD numbers
enum { enum {
@ -95,7 +95,7 @@ typedef struct {
uint8 code; uint8 code;
uint16 checksum; uint16 checksum;
// data // data
} ATTRIBUTE_PACKED icmp_t; } icmp_t;
enum { enum {
icmp_Echo_reply = 0, icmp_Echo_reply = 0,
@ -140,7 +140,7 @@ typedef struct {
uint16 urgent_ptr; uint16 urgent_ptr;
// options + padding: size = dataoffset*4-20 // options + padding: size = dataoffset*4-20
// data // data
} ATTRIBUTE_PACKED tcp_t; } tcp_t;
enum { enum {
tcp_flags_URG = 0x20, // The urgent pointer field is significant in this segment. tcp_flags_URG = 0x20, // The urgent pointer field is significant in this segment.
@ -173,15 +173,15 @@ typedef struct {
uint16 msg_len; uint16 msg_len;
uint16 checksum; uint16 checksum;
// data // data
} ATTRIBUTE_PACKED udp_t; } udp_t;
typedef struct { typedef struct {
uint16 src_lo, src_hi; uint16 src_lo, src_hi;
uint16 dest_lo, dest_hi; uint16 dest_lo, dest_hi;
uint16 proto; uint16 proto;
uint16 msg_len; uint16 msg_len;
} ATTRIBUTE_PACKED pseudo_ip_t; } pseudo_ip_t;
#pragma pack() #pragma pack(pop)
#endif // _ROUTER_TYPES_H_ #endif // _ROUTER_TYPES_H_

View File

@ -166,8 +166,8 @@ public:
private: private:
bool configure(uint16 config); bool configure(uint16 config);
void set_handshake(uint32 s, bool with_dtr); void set_handshake(uint32 s, bool with_dtr);
static WINAPI unsigned int input_func(void *arg); static unsigned int WINAPI input_func(void *arg);
static WINAPI unsigned int output_func(void *arg); static unsigned int WINAPI output_func(void *arg);
static int acknowledge_error(HANDLE h, bool is_read); static int acknowledge_error(HANDLE h, bool is_read);
bool set_timeouts(int bauds, int parity_bits, int stop_bits); bool set_timeouts(int bauds, int parity_bits, int stop_bits);

View File

@ -20,8 +20,6 @@
#include "sysdeps.h" #include "sysdeps.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winioctl.h> #include <winioctl.h>
#include <string> #include <string>
@ -497,11 +495,11 @@ void *Sys_open(const char *path_name, bool read_only)
} }
} }
if (fh->is_floppy && first_floppy == NULL) if (fh) {
first_floppy = fh; if (fh->is_floppy && first_floppy == NULL)
first_floppy = fh;
if (fh)
sys_add_file_handle(fh); sys_add_file_handle(fh);
}
return fh; return fh;
} }
@ -793,7 +791,7 @@ bool SysCDReadTOC(void *arg, uint8 *toc)
NULL, 0, NULL, 0,
toc, min((int)sizeof(CDROM_TOC), 804), toc, min((int)sizeof(CDROM_TOC), 804),
&dummy, &dummy,
NULL); NULL) != FALSE;
} }
@ -819,7 +817,7 @@ bool SysCDGetPosition(void *arg, uint8 *pos)
&q_format, sizeof(CDROM_SUB_Q_DATA_FORMAT), &q_format, sizeof(CDROM_SUB_Q_DATA_FORMAT),
&q_data, sizeof(SUB_Q_CHANNEL_DATA), &q_data, sizeof(SUB_Q_CHANNEL_DATA),
&dwBytesReturned, &dwBytesReturned,
NULL); NULL) != FALSE;
if (ok) if (ok)
memcpy(pos, &q_data.CurrentPosition, sizeof(SUB_Q_CURRENT_POSITION)); memcpy(pos, &q_data.CurrentPosition, sizeof(SUB_Q_CURRENT_POSITION));
@ -851,7 +849,7 @@ bool SysCDPlay(void *arg, uint8 start_m, uint8 start_s, uint8 start_f, uint8 end
&msf, sizeof(CDROM_PLAY_AUDIO_MSF), &msf, sizeof(CDROM_PLAY_AUDIO_MSF),
NULL, 0, NULL, 0,
&dwBytesReturned, &dwBytesReturned,
NULL); NULL) != FALSE;
} }
@ -871,7 +869,7 @@ bool SysCDPause(void *arg)
NULL, 0, NULL, 0,
NULL, 0, NULL, 0,
&dwBytesReturned, &dwBytesReturned,
NULL); NULL) != FALSE;
} }
@ -890,7 +888,7 @@ bool SysCDResume(void *arg)
IOCTL_CDROM_RESUME_AUDIO, IOCTL_CDROM_RESUME_AUDIO,
NULL, 0, NULL, 0,
NULL, 0, NULL, 0,
&dwBytesReturned, NULL); &dwBytesReturned, NULL) != FALSE;
} }
@ -910,7 +908,7 @@ bool SysCDStop(void *arg, uint8 lead_out_m, uint8 lead_out_s, uint8 lead_out_f)
NULL, 0, NULL, 0,
NULL, 0, NULL, 0,
&dwBytesReturned, &dwBytesReturned,
NULL); NULL) != FALSE;
} }
@ -935,7 +933,7 @@ bool SysCDScan(void *arg, uint8 start_m, uint8 start_s, uint8 start_f, bool reve
&msf, sizeof(CDROM_SEEK_AUDIO_MSF), &msf, sizeof(CDROM_SEEK_AUDIO_MSF),
NULL, 0, NULL, 0,
&dwBytesReturned, &dwBytesReturned,
NULL); NULL) != FALSE;
} }

View File

@ -21,7 +21,7 @@
#ifndef SYSDEPS_H #ifndef SYSDEPS_H
#define SYSDEPS_H #define SYSDEPS_H
#ifndef __STDC__ #if !defined _MSC_VER && !defined __STDC__
#error "Your compiler is not ANSI. Get a real one." #error "Your compiler is not ANSI. Get a real one."
#endif #endif
@ -41,9 +41,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#ifdef __WIN32__ #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#endif #include <WinSock2.h>
#include <sys/types.h> #include <sys/types.h>
@ -78,6 +78,10 @@
/* ExtFS is supported */ /* ExtFS is supported */
#define SUPPORTS_EXTFS 1 #define SUPPORTS_EXTFS 1
/* POSIX data types missing from Microsoft's CRT */
#ifdef _MSC_VER
typedef ptrdiff_t ssize_t;
#endif
/* Data types */ /* Data types */
typedef unsigned char uint8; typedef unsigned char uint8;
@ -123,13 +127,21 @@ typedef int64 intptr;
#error "Unsupported size of pointer" #error "Unsupported size of pointer"
#endif #endif
#ifdef __WIN32__ #ifdef _WIN32
typedef int64 loff_t; typedef int64 loff_t;
#endif #endif
#ifndef HAVE_CADDR_T #ifndef HAVE_CADDR_T
typedef char * caddr_t; typedef char * caddr_t;
#endif #endif
#ifdef _MSC_VER
#ifdef _M_IX86
#define __i386__
#elif defined _M_AMD64
#define __x86_64__
#endif
#endif
/* Time data type for Time Manager emulation */ /* Time data type for Time Manager emulation */
typedef int64 tm_time_t; typedef int64 tm_time_t;
@ -207,31 +219,42 @@ static inline int spin_trylock(spinlock_t *lock)
} }
#endif #endif
/* Intel x86 */
#define X86_PPRO_OPT #define X86_PPRO_OPT
#define HAVE_OPTIMIZED_BYTESWAP_32
#define HAVE_OPTIMIZED_BYTESWAP_16
#ifdef _MSC_VER
static inline uae_u32 do_get_mem_long(uae_u32 *a) {return _byteswap_ulong(*a);}
static inline uae_u32 do_get_mem_word(uae_u16 *a) {return _byteswap_ushort(*a);}
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {*a = _byteswap_ulong(v);}
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {*a = _byteswap_ushort(v);}
static inline uae_u32 do_byteswap_32_g(uae_u32 v) {return _byteswap_ulong(v);}
static inline uae_u32 do_byteswap_16_g(uae_u32 v) {return _byteswap_ushort(v);}
#else
/* Intel x86 */
static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("bswap %0" : "=r" (retval) : "0" (*a) : "cc"); return retval;} static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("bswap %0" : "=r" (retval) : "0" (*a) : "cc"); return retval;}
#ifdef X86_PPRO_OPT #ifdef X86_PPRO_OPT
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("movzwl %w1,%k0\n\tshll $16,%k0\n\tbswapl %k0\n" : "=&r" (retval) : "m" (*a) : "cc"); return retval;} static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("movzwl %w1,%k0\n\tshll $16,%k0\n\tbswapl %k0\n" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
#else #else
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("xorl %k0,%k0\n\tmovw %w1,%w0\n\trolw $8,%w0" : "=&r" (retval) : "m" (*a) : "cc"); return retval;} static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("xorl %k0,%k0\n\tmovw %w1,%w0\n\trolw $8,%w0" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
#endif #endif
#define HAVE_GET_WORD_UNSWAPPED
#define do_get_mem_word_unswapped(a) ((uae_u32)*((uae_u16 *)(a)))
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v) : "cc"); *a = v;} static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
#ifdef X86_PPRO_OPT #ifdef X86_PPRO_OPT
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); *a = v;} static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); *a = v;}
#else #else
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;} static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
#endif #endif
#define HAVE_OPTIMIZED_BYTESWAP_32
/* bswap doesn't affect condition codes */ /* bswap doesn't affect condition codes */
static inline uae_u32 do_byteswap_32_g(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;} static inline uae_u32 do_byteswap_32_g(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;}
#define HAVE_OPTIMIZED_BYTESWAP_16
#ifdef X86_PPRO_OPT #ifdef X86_PPRO_OPT
static inline uae_u32 do_byteswap_16_g(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;} static inline uae_u32 do_byteswap_16_g(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;}
#else #else
static inline uae_u32 do_byteswap_16_g(uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); return v;} static inline uae_u32 do_byteswap_16_g(uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); return v;}
#endif #endif
#endif
#define HAVE_GET_WORD_UNSWAPPED
#define do_get_mem_word_unswapped(a) ((uae_u32)*((uae_u16 *)(a)))
#ifndef HAVE_OPTIMIZED_BYTESWAP_32 #ifndef HAVE_OPTIMIZED_BYTESWAP_32
static inline uae_u32 do_byteswap_32_g(uae_u32 v) static inline uae_u32 do_byteswap_32_g(uae_u32 v)
@ -294,8 +317,6 @@ static inline uae_u32 do_byteswap_16_g(uae_u32 v)
#define ENUMNAME(name) name #define ENUMNAME(name) name
#define write_log printf #define write_log printf
#define ATTRIBUTE_PACKED __attribute__((packed))
#if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY) #if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY)
#define ASM_SYM(a) __asm__(a) #define ASM_SYM(a) __asm__(a)
#else #else
@ -307,4 +328,8 @@ static inline uae_u32 do_byteswap_16_g(uae_u32 v)
#endif #endif
#define REGPARAM2 #define REGPARAM2
#ifdef _MSC_VER
#define ATTRIBUTE_PACKED
#endif
#endif #endif

View File

@ -20,9 +20,6 @@
#include "sysdeps.h" #include "sysdeps.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "main.h" #include "main.h"
#include "macos_util.h" #include "macos_util.h"
#include "timer.h" #include "timer.h"
@ -169,9 +166,9 @@ int32 timer_host2mac_time(tm_time_t hosttime)
else { else {
uint64 t = TICKS2USECS(hosttime); uint64 t = TICKS2USECS(hosttime);
if (t > 0x7fffffff) if (t > 0x7fffffff)
return t / 1000; // Time in milliseconds return int32(t / 1000); // Time in milliseconds
else else
return -t; // Time in negative microseconds return -int32(t); // Time in negative microseconds
} }
} }

View File

@ -21,9 +21,6 @@
#include "sysdeps.h" #include "sysdeps.h"
#include "user_strings.h" #include "user_strings.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// Platform-specific string definitions // Platform-specific string definitions
user_string_def platform_strings[] = { user_string_def platform_strings[] = {

View File

@ -23,6 +23,8 @@
#include "sysdeps.h" #include "sysdeps.h"
#include "util_windows.h" #include "util_windows.h"
#include "main.h" #include "main.h"
#include <io.h>
#include <fcntl.h>
#include <list> #include <list>
using std::list; using std::list;
@ -35,10 +37,10 @@ BOOL exists( const char *path )
HFILE h; HFILE h;
bool ret = false; bool ret = false;
h = _lopen( path, OF_READ ); h = _open( path, _O_RDONLY | _O_BINARY );
if(h != HFILE_ERROR) { if(h != -1) {
ret = true; ret = true;
_lclose(h); _close(h);
} }
return(ret); return(ret);
} }

View File

@ -20,9 +20,6 @@
#include "sysdeps.h" #include "sysdeps.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string> #include <string>
using std::string; using std::string;