|
|
2184c4 |
#ifndef _PSXTYPES_NT_COMPILER_MSVC_H_
|
|
|
2184c4 |
#define _PSXTYPES_NT_COMPILER_MSVC_H_
|
|
|
2184c4 |
|
|
|
f29da7 |
/* sigh */
|
|
|
666e11 |
#pragma warning ( disable : 4204 ) /* non-constant aggregate initializer */
|
|
|
1f5997 |
#pragma warning ( disable : 4054 ) /* cast funtion ptr to data ptr */
|
|
|
1f5997 |
#pragma warning ( disable : 4055 ) /* cast data ptr to funtion ptr */
|
|
|
1f5997 |
#pragma warning ( disable : 4127 ) /* constant expression comparisons */
|
|
|
1f5997 |
#pragma warning ( disable : 4152 ) /* cast a function pointer to void */
|
|
|
1f5997 |
#pragma warning ( disable : 4200 ) /* adjust to the 21st century */
|
|
|
1f5997 |
#pragma warning ( disable : 4201 ) /* nameless struct member */
|
|
|
1f5997 |
#pragma warning ( disable : 4702 ) /* unreachable code */
|
|
|
f29da7 |
#pragma warning ( disable : 4706 ) /* assignment within conditional */
|
|
|
f29da7 |
#pragma warning ( disable : 4820 ) /* struct member padding */
|
|
|
2184c4 |
|
|
|
2184c4 |
/* compiler identification */
|
|
|
2184c4 |
#define __COMPILER__ __MSVC__
|
|
|
2184c4 |
#define __COMPILER_DEPENDENT_SUFFIX__ __msvc
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* NTVER: the bare minimum */
|
|
|
2184c4 |
#ifndef NTVER
|
|
|
2184c4 |
#define NTVER 0x0500
|
|
|
2184c4 |
#elif (NTVER < 0x0500)
|
|
|
2184c4 |
#error __^@^__: NTVER: minimum supported NT version is 0x0500.
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* x86 processor model */
|
|
|
32f3d4 |
#ifdef _M_IX86
|
|
|
32f3d4 |
|
|
|
2184c4 |
#if (_M_IX86 == 900)
|
|
|
2184c4 |
#define __X86_MODEL 986
|
|
|
2184c4 |
#elif (_M_IX86 == 800)
|
|
|
2184c4 |
#define __X86_MODEL 886
|
|
|
2184c4 |
#elif (_M_IX86 == 700)
|
|
|
2184c4 |
#define __X86_MODEL 786
|
|
|
2184c4 |
#elif (_M_IX86 == 600)
|
|
|
2184c4 |
#define __X86_MODEL 686
|
|
|
2184c4 |
#elif (_M_IX86 == 500)
|
|
|
2184c4 |
#define __X86_MODEL 586
|
|
|
2184c4 |
#elif (_M_IX86 == 400)
|
|
|
2184c4 |
#define __X86_MODEL 486
|
|
|
2184c4 |
#elif (_M_IX86 == 300)
|
|
|
2184c4 |
#define __X86_MODEL 386
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
32f3d4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
/* x86_64 processor model */
|
|
|
2184c4 |
#if defined(_M_AMD64)
|
|
|
2184c4 |
#define __amd64 1
|
|
|
2184c4 |
#define __X86_64_MODEL __amd64
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
/* compiler keywords */
|
|
|
2184c4 |
#define __in
|
|
|
2184c4 |
#define __out
|
|
|
2184c4 |
#define __in_opt
|
|
|
2184c4 |
#define __out_opt
|
|
|
2184c4 |
#define __in_out
|
|
|
2184c4 |
#define __in_out_opt
|
|
|
2184c4 |
#define __reserved
|
|
|
2184c4 |
#define __optional
|
|
|
2184c4 |
#define __simplified
|
|
|
2184c4 |
#define __caller_allocated
|
|
|
2184c4 |
#define __caller_initialized
|
|
|
2184c4 |
#define __null_placeholder (0x0)
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* __SIZEOF_POINTER__ */
|
|
|
2184c4 |
#if defined(__NT32)
|
|
|
2184c4 |
#define __SIZEOF_POINTER__ 4
|
|
|
2184c4 |
#elif defined(__NT64)
|
|
|
2184c4 |
#define __SIZEOF_POINTER__ 8
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* compiler attributes */
|
|
|
2184c4 |
#define __inline__ __inline
|
|
|
2184c4 |
#define __volatile__ volatile
|
|
|
2184c4 |
#define __attr_aligned__(x) __declspec(align(x))
|
|
|
2184c4 |
#define __attr_ptr_size_aligned__ __attr_aligned__(__SIZEOF_POINTER__)
|
|
|
2184c4 |
#define __attr_packed__
|
|
|
2184c4 |
#define __attr_export__ __declspec(dllexport)
|
|
|
2184c4 |
#define __attr_import__ __declspec(dllimport)
|
|
|
2184c4 |
#define __attr_naked__ __declspec(naked)
|
|
|
68ca7a |
#define __attr_weak__
|
|
|
2184c4 |
|
|
|
2184c4 |
#ifdef __PE_VISIBILITY__
|
|
|
0b6ec0 |
#define __attr_hidden__
|
|
|
0b6ec0 |
#define __attr_public__
|
|
|
0b6ec0 |
#define __attr_protected__
|
|
|
2184c4 |
#else
|
|
|
2184c4 |
#define __attr_hidden__
|
|
|
2184c4 |
#define __attr_public__
|
|
|
2184c4 |
#define __attr_protected__
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
d43821 |
/* offsetof */
|
|
|
d43821 |
#define __offsetof(st,member) ((size_t)((char *)&(((st *)0)->member) - (char *)0))
|
|
|
d43821 |
|
|
|
d43821 |
|
|
|
c27e28 |
/* named section support */
|
|
|
c27e28 |
#define __attr_section__(s)
|
|
|
c27e28 |
#define __attr_section_decl__(s) __declspec(allocate(s))
|
|
|
c27e28 |
#define __SECTION_PRAGMA_REQUIRED__
|
|
|
c27e28 |
|
|
|
c27e28 |
|
|
|
2184c4 |
/* compiler-dependent assertions */
|
|
|
2184c4 |
#define __assert_aligned_size(s,a) typedef char __assert##s [1-((sizeof(s) % a))]
|
|
|
2184c4 |
#define __assert_struct_size(s1,s2) typedef char __assert##s1##s2 [1 + sizeof(s2) -sizeof(s1)]
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* calling conventions */
|
|
|
2184c4 |
#undef __stdcall
|
|
|
2184c4 |
#undef APIENTRY
|
|
|
2184c4 |
#undef CALLBACK
|
|
|
2184c4 |
#undef NTAPI
|
|
|
2184c4 |
#undef WINAPI
|
|
|
2184c4 |
|
|
|
2184c4 |
#define __stdcall _stdcall
|
|
|
2184c4 |
#define APIENTRY __stdcall
|
|
|
2184c4 |
#define CALLBACK __stdcall
|
|
|
2184c4 |
#define NTAPI __stdcall
|
|
|
2184c4 |
#define WINAPI __stdcall
|
|
|
2184c4 |
|
|
|
c089fa |
/* vararg */
|
|
|
c089fa |
typedef char * va_list;
|
|
|
c089fa |
|
|
|
c089fa |
#if defined(__NT32)
|
|
|
c089fa |
void __cdecl __va_start(char ** ,...);
|
|
|
c089fa |
#define __va_size(l) (((sizeof(void *)-1) + sizeof(l)) & ~(sizeof(void *)-1))
|
|
|
c089fa |
#define va_start(v,l) ((void)(v = (char *)((&(l)) + __va_size(l))))
|
|
|
c089fa |
#define va_end(v) ((void)(v = 0))
|
|
|
c089fa |
#endif
|
|
|
c089fa |
|
|
|
c089fa |
#if defined(__NT64)
|
|
|
c089fa |
void __cdecl __va_start(char ** ,...);
|
|
|
c089fa |
#define va_start(v,l) ((void)(__va_start(&v, l)))
|
|
|
c089fa |
#define va_end(v) ((void)(v = 0))
|
|
|
c089fa |
#endif
|
|
|
c089fa |
|
|
|
2184c4 |
#endif /* _PSXTYPES_NT_COMPILER_MSVC_H_ */
|