2 This file is a part of libcds - Concurrent Data Structures library
4 (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
6 Source code repo: http://github.com/khizmax/libcds/
7 Download: http://sourceforge.net/projects/libcds/files/
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are met:
12 * Redistributions of source code must retain the above copyright notice, this
13 list of conditions and the following disclaimer.
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.
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.
31 #ifndef CDSLIB_COMPILER_ICL_DEFS_H
32 #define CDSLIB_COMPILER_ICL_DEFS_H
37 # define CDS_COMPILER_VERSION __ICL
39 # define CDS_COMPILER_VERSION __INTEL_COMPILER
43 // Supported compilers: MS VC 2008, 2010, 2012
45 # define CDS_COMPILER__NAME "Intel C++"
46 # define CDS_COMPILER__NICK "icl"
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"
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"
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"
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
84 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
85 # define __attribute__( _x )
88 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
90 # define CDS_EXPORT_API __declspec(dllexport)
92 # define CDS_EXPORT_API __declspec(dllimport)
96 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
97 # define alignof __alignof
99 # define alignof __alignof__
102 // *************************************************
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))
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)))
116 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
117 # define CDS_DEPRECATED( reason ) __declspec(deprecated( reason ))
118 # define CDS_NORETURN __declspec(noreturn)
120 # define CDS_DEPRECATED( reason ) __attribute__((deprecated( reason )))
121 # define CDS_NORETURN __attribute__((__noreturn__))
125 #if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
126 # if defined( _CPPUNWIND )
127 # define CDS_EXCEPTION_ENABLED
130 # if defined( __EXCEPTIONS ) && __EXCEPTIONS == 1
131 # define CDS_EXCEPTION_ENABLED
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
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
147 # warning "Undefined byte order for current architecture (no __BYTE_ORDER__ preprocessor definition)"
152 // Sanitizer attributes (not supported)
153 #define CDS_SUPPRESS_SANITIZE( ... )
155 #include <cds/compiler/icl/compiler_barriers.h>
158 #endif // #ifndef CDSLIB_COMPILER_VC_DEFS_H