/perf/kseta

To get this branch, use:
bzr branch http://darksoft.org/webbzr/perf/kseta

« back to all changes in this revision

Viewing changes to tutorials/4_pi/random123/features/clangfeatures.h

  • Committer: Suren A. Chilingaryan
  • Date: 2013-10-08 23:53:50 UTC
  • Revision ID: csa@dside.dyndns.org-20131008235350-hsu8oukzkh05gtcm
Add tutorials

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2010-2011, D. E. Shaw Research.
 
3
All rights reserved.
 
4
 
 
5
Redistribution and use in source and binary forms, with or without
 
6
modification, are permitted provided that the following conditions are
 
7
met:
 
8
 
 
9
* Redistributions of source code must retain the above copyright
 
10
  notice, this list of conditions, and the following disclaimer.
 
11
 
 
12
* Redistributions in binary form must reproduce the above copyright
 
13
  notice, this list of conditions, and the following disclaimer in the
 
14
  documentation and/or other materials provided with the distribution.
 
15
 
 
16
* Neither the name of D. E. Shaw Research nor the names of its
 
17
  contributors may be used to endorse or promote products derived from
 
18
  this software without specific prior written permission.
 
19
 
 
20
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
21
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
22
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
23
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
24
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
25
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
26
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
27
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
28
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
29
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
30
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
31
*/
 
32
#ifndef __clangfeatures_dot_hpp
 
33
#define __clangfeatures_dot_hpp
 
34
 
 
35
#ifndef R123_USE_X86INTRIN_H
 
36
#define R123_USE_X86INTRIN_H ((defined(__x86_64__)||defined(__i386__)))
 
37
#endif
 
38
 
 
39
#ifndef R123_USE_CXX11_UNRESTRICTED_UNIONS
 
40
#define R123_USE_CXX11_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions)
 
41
#endif
 
42
 
 
43
#ifndef R123_USE_CXX11_STATIC_ASSERT
 
44
#define R123_USE_CXX11_STATIC_ASSERT __has_feature(cxx_static_assert)
 
45
#endif
 
46
 
 
47
#ifndef R123_USE_CXX11_CONSTEXPR
 
48
#define R123_USE_CXX11_CONSTEXPR __has_feature(cxx_constexpr)
 
49
#endif
 
50
 
 
51
#ifndef R123_USE_CXX11_EXPLICIT_CONVERSIONS
 
52
#define R123_USE_CXX11_EXPLICIT_CONVERSIONS __has_feature(cxx_explicit_conversions)
 
53
#endif
 
54
 
 
55
// With clang-3.0, the apparently simpler:
 
56
//  #define R123_USE_CXX11_RANDOM __has_include(<random>)
 
57
// dumps core.
 
58
#ifndef R123_USE_CXX11_RANDOM
 
59
#if __cplusplus>=201103L && __has_include(<random>)
 
60
#define R123_USE_CXX11_RANDOM 1
 
61
#else
 
62
#define R123_USE_CXX11_RANDOM 0
 
63
#endif
 
64
#endif
 
65
 
 
66
#ifndef R123_USE_CXX11_TYPE_TRAITS
 
67
#if __cplusplus>=201103L && __has_include(<type_traits>)
 
68
#define R123_USE_CXX11_TYPE_TRAITS 1
 
69
#else
 
70
#define R123_USE_CXX11_TYPE_TRAITS 0
 
71
#endif
 
72
#endif
 
73
 
 
74
#include "gccfeatures.h"
 
75
 
 
76
#endif