source: trunk/lib/config.hpp @ 1527

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

ICC defaults to GCC.

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