|
|
2184c4 |
#ifndef _PSXTYPES_COMPILER_GCC_H_
|
|
|
2184c4 |
#define _PSXTYPES_COMPILER_GCC_H_
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* compiler identification */
|
|
|
2184c4 |
#define __COMPILER__ __GCC__
|
|
|
2184c4 |
#define __COMPILER_DEPENDENT_SUFFIX__ __gcc
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* x86 processor model */
|
|
|
2184c4 |
#if defined(__i986__)
|
|
|
2184c4 |
#define __X86_MODEL 986
|
|
|
2184c4 |
#elif defined(__i886__)
|
|
|
2184c4 |
#define __X86_MODEL 886
|
|
|
2184c4 |
#elif defined(__i786__)
|
|
|
2184c4 |
#define __X86_MODEL 786
|
|
|
2184c4 |
#elif defined(__i686__)
|
|
|
2184c4 |
#define __X86_MODEL 686
|
|
|
2184c4 |
#elif defined(__i586__)
|
|
|
2184c4 |
#define __X86_MODEL 586
|
|
|
2184c4 |
#elif defined(__i486__)
|
|
|
2184c4 |
#define __X86_MODEL 486
|
|
|
2184c4 |
#elif defined(__i386__)
|
|
|
2184c4 |
#define __X86_MODEL 386
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* x86_64 processor model */
|
|
|
2184c4 |
#if defined(__amd64) && (__amd64)
|
|
|
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 |
/* compiler attributes */
|
|
|
2184c4 |
#define __attr_aligned__(x) __attribute__((__aligned__(x)))
|
|
|
2184c4 |
#define __attr_ptr_size_aligned__ __attr_aligned__(__SIZEOF_POINTER__)
|
|
|
2184c4 |
#define __attr_packed__ __attribute__((__packed__))
|
|
|
2184c4 |
#define __attr_export__ __attribute__((dllexport))
|
|
|
2184c4 |
#define __attr_import__ __attribute__((dllimport))
|
|
|
2184c4 |
#define __attr_naked__
|
|
|
68ca7a |
#define __attr_weak__ __attribute__ ((weak))
|
|
|
2184c4 |
#define __attr_hidden__ __attribute__ ((visibility("hidden")))
|
|
|
2184c4 |
#define __attr_public__ __attribute__ ((visibility("default")))
|
|
|
2184c4 |
#define __attr_protected__ __attribute__ ((visibility("protected")))
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
d43821 |
/* offsetof */
|
|
|
d43821 |
#define __offsetof(st,member) __builtin_offsetof(st,member)
|
|
|
d43821 |
|
|
|
d43821 |
|
|
|
c27e28 |
/* named section support */
|
|
|
c27e28 |
#define __attr_section__(s) __attribute__((section(s)))
|
|
|
c27e28 |
#define __attr_section_decl__(s)
|
|
|
c27e28 |
|
|
|
c27e28 |
|
|
|
2184c4 |
/* compiler-dependent assertions */
|
|
|
2184c4 |
#define __assert_aligned_size(s,a) typedef char __assert##s [-(sizeof(s) % a)]
|
|
|
2184c4 |
#define __assert_struct_size(s1,s2) typedef char __assert##s1##s2 [sizeof(s2) -sizeof(s1)]
|
|
|
2184c4 |
|
|
|
2184c4 |
|
|
|
2184c4 |
/* calling conventions */
|
|
|
2184c4 |
#ifndef __cdecl
|
|
|
2184c4 |
#define __cdecl
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
#ifndef __fastcall
|
|
|
2184c4 |
#define __fastcall
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
#ifndef __stdcall
|
|
|
2184c4 |
#define __stdcall
|
|
|
2184c4 |
#endif
|
|
|
2184c4 |
|
|
|
2184c4 |
#undef APIENTRY
|
|
|
2184c4 |
#undef CALLBACK
|
|
|
2184c4 |
#undef NTAPI
|
|
|
2184c4 |
#undef WINAPI
|
|
|
2184c4 |
|
|
|
2184c4 |
#define APIENTRY
|
|
|
2184c4 |
#define CALLBACK
|
|
|
2184c4 |
#define NTAPI
|
|
|
2184c4 |
#define WINAPI
|
|
|
2184c4 |
|
|
|
c089fa |
/* vararg */
|
|
|
c089fa |
typedef __builtin_va_list va_list;
|
|
|
c089fa |
|
|
|
c089fa |
#define va_start(v,l) __builtin_va_start(v,l)
|
|
|
c089fa |
#define va_end(v) __builtin_va_end(v)
|
|
|
c089fa |
#define va_arg(v,l) __builtin_va_arg(v,l)
|
|
|
c089fa |
#define va_copy(d,s) __builtin_va_copy(d,s)
|
|
|
c089fa |
|
|
|
2184c4 |
#endif /* _PSXTYPES_COMPILER_GCC_H_ */
|