source: trunk/lib/config.hpp @ 1509

Last change on this file since 1509 was 1509, checked in by ksherdy, 8 years ago

Added builtin.hpp for compiler specific builtins. Prefer GCC supported builtins, function decorators over ICC.

File size: 1.9 KB
Line 
1/*
2    config - Compiler dependent configuration.
3
4    Idealized SIMD Operations with SSE versions
5    Copyright (C) 2011, Robert D. Cameron, Kenneth S. Herdy, Hua Huang and Nigel Medforth.
6    Licensed to the public under the Open Software License 3.0.
7    Licensed to International Characters Inc.
8       under the Academic Free License version 3.0.
9 */
10
11#ifndef CONFIG_HPP_
12#define CONFIG_HPP_
13
14/*
15 * IDISA_INLINE is a macro which expands to tell the compiler that the method
16 * decorated with it should be inlined.  This macro is usable from C and C++
17 * code, even though C89 does not support the |inline| keyword.  The compiler
18 * may ignore this directive if it chooses.
19 */
20#ifndef IDISA_INLINE
21        #if defined __cplusplus
22                #define IDISA_INLINE          inline
23        #elif defined _MSC_VER
24                #define IDISA_INLINE          __inline
25        #elif defined __GNUC__
26                #define IDISA_INLINE          __inline__
27        #elif defined __INTEL_COMPILER
28                #define IDISA_INLINE              __inline // See, Intel® C++ Compiler User and Reference Guides
29        #else
30                #define IDISA_INLINE          inline
31        #endif
32#endif
33
34/*
35 * IDISA_INLINE is a macro which expands to tell the compiler that the
36 * method decorated with it must be inlined, even if the compiler thinks
37 * otherwise.  This is only a (much) stronger version of the IDISA_INLINE hint:
38 * compilers are not guaranteed to respect it (although they're much more likely
39 * to do so).
40 */
41#ifndef IDISA_ALWAYS_INLINE
42        #if defined IDISA_DEBUG
43                #define IDISA_ALWAYS_INLINE   IDISA_INLINE
44        #elif defined _MSC_VER
45                #define IDISA_ALWAYS_INLINE   __forceinline
46        #elif defined __GNUC__
47                #define IDISA_ALWAYS_INLINE   __attribute__((always_inline)) IDISA_INLINE
48        #elif defined __INTEL_COMPILER
49                #define IDISA_ALWAYS_INLINE     __forceinline // See, Intel® C++ Compiler User and Reference Guides
50        #else
51                #define IDISA_ALWAYS_INLINE   IDISA_INLINE
52        #endif
53#endif
54
55#endif /* CONFIG_HPP_ */
Note: See TracBrowser for help on using the repository browser.