source: CLRX/CLRadeonExtender/trunk/CLRX/Config.h.in @ 3370

Last change on this file since 3370 was 3370, checked in by matszpk, 13 months ago

CLRadeonExtender: Add checking C++11 Thread call_once. Add detection OpenCL in MinGW64 environment.

File size: 6.5 KB
Line 
1/*
2 *  CLRadeonExtender - Unofficial OpenCL Radeon Extensions Library
3 *  Copyright (C) 2014-2017 Mateusz Szpakowski
4 *
5 *  This library is free software; you can redistribute it and/or
6 *  modify it under the terms of the GNU Lesser General Public
7 *  License as published by the Free Software Foundation; either
8 *  version 2.1 of the License, or (at your option) any later version.
9 *
10 *  This library is distributed in the hope that it will be useful,
11 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 *  Lesser General Public License for more details.
14 *
15 *  You should have received a copy of the GNU Lesser General Public
16 *  License along with this library; if not, write to the Free Software
17 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19
20/*! \file Config.h
21 * \brief Configuration header
22 */
23
24#ifndef __CLRX_CONFIG_H__
25#define __CLRX_CONFIG_H__
26
27/// CLRadeonExtender version
28#define CLRX_VERSION "${CLRX_VERSION}"
29
30/// CLRadeonExtender major version
31#define CLRX_MAJOR_VERSION ${CLRX_MAJOR_VERSION}
32/// CLRadeonExtender minor version
33#define CLRX_MINOR_VERSION ${CLRX_MINOR_VERSION}
34/// CLRadeonExtender micro version
35#define CLRX_MICRO_VERSION ${CLRX_MICRO_VERSION}
36/// CLRadeonExtender revision string
37#define CLRX_REVISION "${CLRX_REVISION}"
38
39#cmakedefine HAVE_GNU11
40
41#cmakedefine HAVE_ELF_H
42
43#cmakedefine HAVE_INT128
44
45#cmakedefine HAVE_CALL_ONCE
46
47/* architecture setup */
48
49#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || \
50        defined(_M_IX86) || defined(__i386) || defined(_X86_)
51#  define HAVE_ARCH_INTEL 1
52#  define HAVE_ARCH_X86 1
53#  define HAVE_32BIT 1
54#endif
55
56#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || \
57        defined(_M_X64) || defined(_M_AMD64)
58#  define HAVE_ARCH_INTEL 1
59#  define HAVE_ARCH_X86_64 1
60#  define HAVE_64BIT 1
61#endif
62
63#if defined(__powerpc__) || defined(__powerpc) || defined(_M_PPC) || \
64    defined(__POWERPC__) || defined(__ppc)
65#  define HAVE_ARCH_POWERPC 1
66#  if defined(__powerpc64__) || defined(__ppc64__) || _M_PPC>=620 || defined(__arch64__)
67#    define HAVE_ARCH_POWERPC64 1
68#    define HAVE_64BIT 1
69#  else
70#    define HAVE_ARCH_POWERPC32 1
71#    define HAVE_32BIT 1
72#  endif
73#endif
74
75#if defined(__arm__) || defined(__thumb__) || defined(_M_ARM) || defined(_M_ARMT)
76#  define HAVE_ARCH_ARM 1
77#  if defined(__aarch64__)
78#    define HAVE_ARCH_ARM64 1
79#    define HAVE_64BIT 1
80#  else
81#    define HAVE_ARCH_ARM32 1
82#    define HAVE_32BIT 1
83#  endif
84#endif
85
86#if !defined(HAVE_ARCH_ARM) && defined(__aarch64__)
87#  define HAVE_ARCH_ARM 1
88#  define HAVE_ARCH_ARM64 1
89#  define HAVE_64BIT 1
90#endif
91
92/* endianness */
93#if defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || \
94    defined(__AARCH64EB__) || defined(_MIPSEB)  || defined(__MIPSEB__) || \
95    defined(__MIPSEB)
96#  define HAVE_BIG_ENDIAN 1
97#else
98#  define HAVE_LITTLE_ENDIAN 1
99#endif
100
101/* machine bits */
102#if !defined(HAVE_32BIT) && !defined(HAVE_64BIT)
103#  ifdef _WIN64
104#    define HAVE_64BIT 1
105#  else
106#    ifdef _WIN32
107#      define HAVE_32BIT 1
108#    endif
109#  endif
110#endif
111
112#if !defined(HAVE_32BIT) && !defined(HAVE_64BIT)
113#  if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__==8
114#    define HAVE_64BIT 1
115#  else
116#    define HAVE_32BIT 1
117#  endif
118#endif
119
120/* operating system */
121
122#ifdef __GNU__
123#  define HAVE_GNU 1
124#endif
125
126#if defined(__linux__) || defined(linux)
127#  define HAVE_LINUX 1
128#endif
129
130#if defined(_WIN32) || defined(_WIN64) || defined(__WINDOWS__) || defined(__WIN32__)
131#  define HAVE_WINDOWS 1
132#endif
133
134#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
135        defined(__bsdi__) || defined(__DragonFly__)
136#  define HAVE_BSD 1
137#endif
138
139#if defined(__MINGW32__) || defined(__MINGW64__)
140#  define HAVE_MINGW 1
141#endif
142
143/* config setup */
144
145#ifndef HAVE_WINDOWS
146/// system configuration path
147#  define SYSTEM_CONFIG_PATH "/etc"
148
149#  ifdef HAVE_32BIT
150/// default AMDOCL name
151#    define DEFAULT_AMDOCLNAME "libamdocl32.so"
152#  else
153/// default AMDOCL name
154#    define DEFAULT_AMDOCLNAME "libamdocl64.so"
155#  endif
156
157/// native directory separator character
158#  define CLRX_NATIVE_DIR_SEP '/'
159/// native directory separator string
160#  define CLRX_NATIVE_DIR_SEP_S "/"
161
162/// alternative directory separator character
163#  define CLRX_ALT_DIR_SEP '\\'
164/// alternative directory separator string
165#  define CLRX_ALT_DIR_SEP_S "\\"
166
167#else
168/// system configuration path
169#  define SYSTEM_CONFIG_PATH "c:\\etc"
170
171#  ifdef HAVE_32BIT
172/// default AMDOCL name
173#  define DEFAULT_AMDOCLNAME "amdocl.dll"
174#  else
175/// default AMDOCL name
176#  define DEFAULT_AMDOCLNAME "amdocl64.dll"
177#  endif
178
179/// native directory separator character
180#  define CLRX_NATIVE_DIR_SEP '\\'
181/// native directory separator string
182#  define CLRX_NATIVE_DIR_SEP_S "\\"
183
184/// alternative directory separator character
185#  define CLRX_ALT_DIR_SEP '/'
186/// alternative directory separator string
187#  define CLRX_ALT_DIR_SEP_S "/"
188
189#  ifndef HAVE_MINGW
190#    define strcasecmp(A,B) _stricmp(A,B)
191#    define strncasecmp(A,B,N) _strnicmp(A,B,N)
192#    if defined(_MSC_VER) && _MSC_VER<1900
193#      define snprintf(B,N,F,...) _snprintf(B,N,F,__VA_ARGS__)
194#    endif
195#  endif
196#endif
197
198/* symbols visibility */
199
200#if __GNUC__ >= 4 && !defined(__CYGWIN__) && !defined(HAVE_MINGW)
201#  define CLRX_INTERNAL __attribute__((visibility("hidden")))
202#else
203#  define CLRX_INTERNAL
204#endif
205
206/* types and defs */
207
208/// signed character (signed byte)
209typedef signed char cxchar;
210/// unsigned character (unsigned byte)
211typedef unsigned char cxuchar;
212/// unsigned byte
213typedef unsigned char cxbyte;
214/// signed short
215typedef signed short cxshort;
216/// unsigned short
217typedef unsigned short cxushort;
218/// signed int
219typedef signed int cxint;
220/// unsigned int
221typedef unsigned int cxuint;
222/// signed long
223typedef signed long cxlong;
224/// unsigned long
225typedef unsigned long cxulong;
226/// signed long long
227typedef signed long long cxllong;
228/// unsigned long long
229typedef unsigned long long cxullong;
230#ifdef _MSC_VER
231#  ifdef HAVE_64BIT
232typedef signed long long ssize_t;
233#    define SSIZE_MIN (-9223372036854775808LL)
234#    define SSIZE_MAX (9223372036854775807LL)
235#  else
236typedef signed long ssize_t;
237#    define SSIZE_MIN (-2147483648LL)
238#    define SSIZE_MAX (2147483647LL)
239#  endif
240#  define NOMINMAX
241#endif
242
243#if __cplusplus < 201103L || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) || defined(HAVE_MINGW)
244#  ifndef __STDC_LIMIT_MACROS
245#    define __STDC_LIMIT_MACROS 1
246#  endif
247#  ifndef __STDC_FORMAT_MACROS
248#    define __STDC_FORMAT_MACROS 1
249#  endif
250#endif
251
252#endif
Note: See TracBrowser for help on using the repository browser.