source: trunk/lib/config.hpp @ 1835

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

Fixed IDISA_ALWAYS_INLINE macro.

File size: 2.0 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#if !(defined (_MSC_VER) || (defined __GNUC__))
15        #error "Compiler not supported. Aborting compilation."
16#endif
17
18/*
19 * IDISA_INLINE is a macro which expands to tell the compiler that the method
20 * decorated with it should be inlined.  This macro is usable from C and C++
21 * code, even though C89 does not support the |inline| keyword.  The compiler
22 * may ignore this directive if it chooses.
23 */
24#ifndef IDISA_INLINE
25        #if defined __cplusplus
26                #define IDISA_INLINE          inline
27        #elif defined _MSC_VER
28                #define IDISA_INLINE          __inline
29        //      #elif defined __INTEL_COMPILER
30        //              #define IDISA_INLINE              __inline // ICC defaults to GCC. See, Intel® C++ Compiler User and Reference Guides
31        #elif defined __GNUC__
32                #define IDISA_INLINE          __inline__
33        #else
34                #define IDISA_INLINE          inline
35        #endif
36#endif
37
38/*
39 * IDISA_INLINE is a macro which expands to tell the compiler that the
40 * method decorated with it must be inlined, even if the compiler thinks
41 * otherwise.  This is only a (much) stronger version of the IDISA_INLINE hint:
42 * compilers are not guaranteed to respect it (although they're much more likely
43 * to do so).
44 */
45#ifndef IDISA_ALWAYS_INLINE
46        #if defined IDISA_DEBUG
47                #define IDISA_ALWAYS_INLINE   IDISA_INLINE
48        #elif defined _MSC_VER
49                #define IDISA_ALWAYS_INLINE   __forceinline
50        //      #elif defined __INTEL_COMPILER
51        //              #define IDISA_ALWAYS_INLINE     __forceinline // ICC defaults to GCC. See, Intel® C++ Compiler User and Reference Guides
52        #elif defined __GNUC__
53                #define IDISA_ALWAYS_INLINE   __attribute__((always_inline)) IDISA_INLINE
54        #else
55                #define IDISA_ALWAYS_INLINE   IDISA_INLINE
56        #endif
57#endif
58
59#endif /* CONFIG_HPP_ */
Note: See TracBrowser for help on using the repository browser.