|
|
1.1 root 1: /*
2: * Hatari - Fix for compliation using Visual Studio 6
3: *
4: * This file is distributed under the GNU Public License, version 2 or at
5: * your option any later version. Read the file gpl.txt for details.
6: *
7: * This file tells Visual Studio to ignore a number of relatively minor "warnings" that have found their
8: * way into the HAtari source. None of the "warnings" will hamper the running or compliation or HAtari
9: * but it is possible not addressing them may make it difficult for other developers to be sure of the
10: * intentions of the original coders against whos code these warnings are raised.
11: * As long as the original coder was aware of the warnings and of the implicit result of adding no
12: * explicit casts to remove them then things are good.
13: *
14: * 2009 Vaughan Kaufman
15: *
16: */
17:
18: #if defined(_VCWIN_) // Stop Visual Studio complaining about all the implicit type conversions (wish we would make them explict guys/girls)
19: #pragma warning (disable:4244) // conversion with potential data loss
20: #pragma warning (disable:4761) // integral size mismatch in argument
21: #pragma warning (disable:4146) // unary minus operator applied to unsigned type
22: #pragma warning (disable:4018) // signed / unsigned mismatch
23: #pragma warning (disable:4102) // ignore unused label warning
24: #pragma warning (disable:4049) // (this one is silly, its not important) compiler limit, end of line numbering
25: #pragma warning (disable:4800) // Performance Warning on Conversion of bool to int
26: #pragma warning (disable:4805) // warning C4805: '|=' : unsafe mix of type 'int' and type 'bool' in operation
27:
28: #ifndef __STDC__
29: #define __STDC__ TRUE
30: #endif
31: #endif
32:
33: /*
34: * KVK - Fix for compliation using Visual Studio 6
35: *
36: * Microsoft have created multiple versions of the standard C calls, a specific version exists for each type of string encoding
37: * format (in this case UNICODE (Wide) and ANSI (Ascii) versions. This has lead to there being versions with a A or a W after
38: * the name to signify the encoding. There are other additional reasons why they have these different versions (something to
39: * do with the change from BSTR to string class passing I think, anyone?). The upshot is, we need to add a _ to the beginning of
40: * some of the function names for HAtari to compile..
41: *
42: * 2009 Vaughan Kaufman
43: * 2013 Vaughan Kaufman (revised for PrEv, NeXt Emulator)
44: */
45:
46: #if defined(_VCWIN_)
47: #define STATIC_INLINE static __inline
48: #define GLOB_ONLYDIR 0
49:
50: #include <io.h>
51: #include <direct.h>
52: #include <stdbool.h>
53: #include <tchar.h>
54:
55: #include <dirent.h>
56:
57: #if !defined TCHAR
58: #define TCHAR char
59: #endif
60:
61: #ifndef PATH_MAX
62: #define PATH_MAX MAX_PATH
63: #endif
64:
65: #define stat _stat
66: #ifdef S_IRUSR
67: #undef S_IRUSR
68: #endif
69: #define S_IRUSR _S_IREAD
70: #ifdef S_IWUSR
71: #undef S_IWUSR
72: #endif
73: #define S_IWUSR _S_IWRITE
74: #ifdef S_ISDIR
75: #undef S_ISDIR
76: #endif
77: #define S_ISDIR(val) (_S_IFDIR & val)
78: #ifdef S_IFDIR
79: #undef S_IFDIR
80: #endif
81: #define S_IFDIR _S_IFDIR
82:
83: #define strncasecmp _strnicmp
84: #ifndef strcasecmp
85: #define strcasecmp _stricmp
86: #endif
87: #define chdrive _chdrive
88: #define strdup _strdup
89: #define getcwd _getcwd
90: #define fileno _fileno
91: #define unlink _unlink
92: #define access _access
93: #ifndef mkdir
94: // #define mkdir(name,mode) _mkdir(name)
95: #endif
96: #define rmdir _rmdir
97: // #define chmod _chmod
98: #define itoa _itoa
99: #define stricmp _stricmp
100: #define snprintf _snprintf
101: #define vsnprintf _vsnprintf
102:
103: #define __attribute__(x) /* x */
104:
105: // For new UI
106:
107: #ifndef _NEW_UI_TYPES
108: #define _NEW_UI_TYPES
109: typedef unsigned short mode_t;
110:
111: #define off_t mode_t
112:
113: typedef signed __int8 int8;
114: typedef unsigned __int8 uint8;
115: typedef unsigned __int8 Uint8;
116: typedef signed __int16 int16;
117: typedef unsigned __int16 uint16;
118: typedef unsigned __int16 Uint16;
119: typedef signed __int32 int32;
120: typedef unsigned __int32 uint32;
121: typedef unsigned __int32 Uint32;
122: typedef signed __int64 int64;
123: typedef unsigned __int64 uint64;
124: typedef void* memptr;
125: #endif
126:
127: #ifndef __inline__
128: #define __inline__ __inline
129: #endif
130:
131: // #include "..\SDL\include\SDL_config_win32.h"
132:
133: /* // Found in SDL_Config_Win32.h
134: #define int8_t signed __int8
135: #define uint8_t unsigned __int8
136: #define int16_t signed __int16
137: #define uint16_t unsigned __int16
138: #define int32_t signed __int32
139: #define uint32_t unsigned __int32
140: #define int64_t signed __int64
141: #define uint64_t unsigned __int64
142: */
143:
144: /* typedef signed __int8 int8_t;
145: typedef unsigned __int8 uint8_t;
146: typedef signed __int16 int16_t;
147: typedef unsigned __int16 uint16_t;
148: typedef signed __int32 int32_t;
149: typedef unsigned __int32 uint32_t;
150: typedef signed __int64 int64_t;
151: typedef unsigned __int64 uint64_t;
152: */
153:
154: /* The variable-types used in the CPU core: */
155: typedef unsigned __int8 uae_u8;
156: typedef signed __int8 uae_s8;
157:
158: typedef unsigned __int16 uae_u16;
159: typedef signed __int16 uae_s16;
160:
161: // typedef unsigned __int16 uae_u32; // Found in SysDeps.h
162: typedef signed __int32 uae_s32;
163:
164: typedef signed __int32 uaecptr;
165:
166: extern void LOG_TRACE(int level, ...);
167: extern void LOG_TRACE_PRINT(char* strFirstString, ...);
168:
169: #ifdef JOY_BUTTON1
170: #undef JOY_BUTTON1
171: #endif
172: #ifdef JOY_BUTTON2
173: #undef JOY_BUTTON2
174: #endif
175:
176: extern void Win_OpenCon(void);
177:
178: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.