source: trunk/lib/config.hpp @ 1584

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

Added preprocessor guard.

File size: 2.0 KB
RevLine 
[1504]1/*
[1506]2    config - Compiler dependent configuration.
[1504]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
[1530]14#if !(defined (_MSC_VER) || (defined __GNUC__))
15        #error "Compiler not supported. Aborting compilation."
[1510]16#endif
17
[1506]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
[1508]25        #if defined __cplusplus
26                #define IDISA_INLINE          inline
27        #elif defined _MSC_VER
28                #define IDISA_INLINE          __inline
[1514]29        //      #elif defined __INTEL_COMPILER
30        //              #define IDISA_INLINE              __inline // ICC defaults to GCC. See, Intel® C++ Compiler User and Reference Guides
[1509]31        #elif defined __GNUC__
32                #define IDISA_INLINE          __inline__
[1508]33        #else
34                #define IDISA_INLINE          inline
35        #endif
[1506]36#endif
[1504]37
[1506]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
[1508]46        #if defined IDISA_DEBUG
47                #define IDISA_ALWAYS_INLINE   IDISA_INLINE
48        #elif defined _MSC_VER
49                #define IDISA_ALWAYS_INLINE   __forceinline
[1514]50        //      #elif defined __INTEL_COMPILER
51        //              #define IDISA_ALWAYS_INLINE     __forceinline // ICC defaults to GCC. See, Intel® C++ Compiler User and Reference Guides
[1509]52        #elif defined __GNUC__
[1530]53                #define IDISA_ALWAYS_INLINE   __attribute__((always_inline))
[1508]54        #else
55                #define IDISA_ALWAYS_INLINE   IDISA_INLINE
56        #endif
[1506]57#endif
[1508]58
[1504]59#endif /* CONFIG_HPP_ */
Note: See TracBrowser for help on using the repository browser.