summaryrefslogtreecommitdiffhomepage
path: root/include/ntapi/nt_compiler.h
blob: 0336330156b2689c4df40e543b4a7b81337b6e14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef _NT_COMPILER_H_
#define _NT_COMPILER_H_

#include "nt_abi.h"

#ifndef _MIDIPIX_FREESTANDING

#ifdef  _MSC_VER

/* visual studio: begin */
#ifdef  _M_IX86
#ifndef __SIZEOF_POINTER__
#define __SIZEOF_POINTER__ 4
#endif
#endif

#ifdef _M_X64
#ifndef __SIZEOF_POINTER__
#define __SIZEOF_POINTER__ 8
#endif
#endif

#ifndef __attr_aligned__
#define __attr_aligned__(x)         __declspec(align(x))
#define __attr_ptr_size_aligned__   __attr_aligned__(__SIZEOF_POINTER__)
#define __assert_aligned_size(s,a)  typedef char __assert##s [1-((sizeof(s) % a))]
#endif

#ifndef __attr_export__
#define __attr_export__             __declspec(dllexport)
#define __attr_import__             __declspec(dllimport)
#endif

#ifndef _DALIST_FREESTANDING
#define _DALIST_FREESTANDING
#endif
/* visual studio: end */

#else

/* all other compilers: begin */
#ifndef __attr_aligned__
#define __attr_aligned__(x)         __attribute__((aligned(x)))
#define __attr_ptr_size_aligned__   __attr_aligned__(__SIZEOF_POINTER__)
#define __assert_aligned_size(s,a)  typedef char __assert##s [-(sizeof(s) % a)]
#endif

#ifndef __attr_export__
#define __attr_export__             __attribute__((__dllexport__))
#define __attr_import__             __attribute__((__dllimport__))
#endif
/* all other compilers: end */

#endif

#endif

#endif