fixed adding file problem
[c11concurrency-benchmarks.git] / gdax-orderbook-hpp / demo / dependencies / libcds-2.3.2 / cds / compiler / icl / defs.h
1 /*
2     This file is a part of libcds - Concurrent Data Structures library
3
4     (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
5
6     Source code repo: http://github.com/khizmax/libcds/
7     Download: http://sourceforge.net/projects/libcds/files/
8
9     Redistribution and use in source and binary forms, with or without
10     modification, are permitted provided that the following conditions are met:
11
12     * Redistributions of source code must retain the above copyright notice, this
13       list of conditions and the following disclaimer.
14
15     * Redistributions in binary form must reproduce the above copyright notice,
16       this list of conditions and the following disclaimer in the documentation
17       and/or other materials provided with the distribution.
18
19     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23     FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24     DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27     OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 #ifndef CDSLIB_COMPILER_ICL_DEFS_H
32 #define CDSLIB_COMPILER_ICL_DEFS_H
33 //@cond
34
35 // Compiler version
36 #ifdef __ICL
37 #   define CDS_COMPILER_VERSION    __ICL
38 #else
39 #   define CDS_COMPILER_VERSION    __INTEL_COMPILER
40 #endif
41
42 // Compiler name
43 // Supported compilers: MS VC 2008, 2010, 2012
44 //
45 #   define  CDS_COMPILER__NAME  "Intel C++"
46 #   define  CDS_COMPILER__NICK  "icl"
47
48 // OS name
49 #if defined(_WIN64)
50 #   define CDS_OS_INTERFACE CDS_OSI_WINDOWS
51 #   define CDS_OS_TYPE      CDS_OS_WIN64
52 #   define CDS_OS__NAME     "Win64"
53 #   define CDS_OS__NICK     "Win64"
54 #elif defined(_WIN32)
55 #   define CDS_OS_INTERFACE CDS_OSI_WINDOWS
56 #   define CDS_OS_TYPE      CDS_OS_WIN32
57 #   define CDS_OS__NAME     "Win32"
58 #   define CDS_OS__NICK     "Win32"
59 #elif defined( __linux__ )
60 #   define CDS_OS_INTERFACE     CDS_OSI_UNIX
61 #   define CDS_OS_TYPE          CDS_OS_LINUX
62 #   define CDS_OS__NAME         "linux"
63 #   define CDS_OS__NICK         "linux"
64 #endif
65
66 // Processor architecture
67 #if defined(_M_X64) || defined(_M_AMD64) || defined(__amd64__) || defined(__amd64)
68 #   define CDS_BUILD_BITS       64
69 #   define CDS_PROCESSOR_ARCH   CDS_PROCESSOR_AMD64
70 #   define CDS_PROCESSOR__NAME  "AMD64"
71 #   define CDS_PROCESSOR__NICK  "amd64"
72 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
73 #   define CDS_BUILD_BITS       32
74 #   define CDS_PROCESSOR_ARCH   CDS_PROCESSOR_X86
75 #   define CDS_PROCESSOR__NAME  "Intel x86"
76 #   define CDS_PROCESSOR__NICK  "x86"
77 #else
78 #   define CDS_BUILD_BITS        -1
79 #   define CDS_PROCESSOR_ARCH    CDS_PROCESSOR_UNKNOWN
80 #   define CDS_PROCESSOR__NAME    "<<Undefined>>"
81 #   error Intel C++ compiler is supported for x86 only
82 #endif
83
84 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
85 #   define  __attribute__( _x )
86 #endif
87
88 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
89 #   ifdef CDS_BUILD_LIB
90 #       define CDS_EXPORT_API          __declspec(dllexport)
91 #   else
92 #       define CDS_EXPORT_API          __declspec(dllimport)
93 #   endif
94 #endif
95
96 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
97 #   define alignof     __alignof
98 #else
99 #   define alignof __alignof__
100 #endif
101
102 // *************************************************
103 // Alignment macro
104
105 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
106 #   define CDS_TYPE_ALIGNMENT(n)     __declspec( align(n))
107 #   define CDS_DATA_ALIGNMENT(n)     __declspec( align(n))
108 #   define CDS_CLASS_ALIGNMENT(n)    __declspec( align(n))
109 #else
110 #   define CDS_TYPE_ALIGNMENT(n)   __attribute__ ((aligned (n)))
111 #   define CDS_CLASS_ALIGNMENT(n)  __attribute__ ((aligned (n)))
112 #   define CDS_DATA_ALIGNMENT(n)   __attribute__ ((aligned (n)))
113 #endif
114
115 // Attributes
116 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
117 #   define CDS_DEPRECATED( reason ) __declspec(deprecated( reason ))
118 #   define CDS_NORETURN __declspec(noreturn)
119 #else
120 #   define CDS_DEPRECATED( reason ) __attribute__((deprecated( reason )))
121 #   define CDS_NORETURN __attribute__((__noreturn__))
122 #endif
123
124 // Exceptions
125 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
126 #   if defined( _CPPUNWIND )
127 #       define CDS_EXCEPTION_ENABLED
128 #   endif
129 #else
130 #   if defined( __EXCEPTIONS ) && __EXCEPTIONS == 1
131 #       define CDS_EXCEPTION_ENABLED
132 #   endif
133 #endif
134
135 // Byte order
136 #if !defined(CDS_ARCH_LITTLE_ENDIAN) && !defined(CDS_ARCH_BIG_ENDIAN)
137 #   if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
138 #       define CDS_ARCH_LITTLE_ENDIAN
139 #   else
140 #       ifdef __BYTE_ORDER__
141 #           if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
142 #               define CDS_ARCH_LITTLE_ENDIAN
143 #           elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
144 #               define CDS_ARCH_BIG_ENDIAN
145 #           endif
146 #       else
147 #           warning "Undefined byte order for current architecture (no __BYTE_ORDER__ preprocessor definition)"
148 #       endif
149 #   endif
150 #endif
151
152 // Sanitizer attributes (not supported)
153 #define CDS_SUPPRESS_SANITIZE( ... )
154
155 #include <cds/compiler/icl/compiler_barriers.h>
156
157 //@endcond
158 #endif // #ifndef CDSLIB_COMPILER_VC_DEFS_H