Changeset 1506 for trunk/lib


Ignore:
Timestamp:
Oct 3, 2011, 2:41:37 PM (8 years ago)
Author:
ksherdy
Message:

Compiler dependent config styled after the Firefox config impl.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/config.hpp

    r1504 r1506  
    11/*
    2     config -
     2    config - Compiler dependent configuration.
    33
    44    Idealized SIMD Operations with SSE versions
     
    1212#define CONFIG_HPP_
    1313
     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
    1433
     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
    1554#endif /* CONFIG_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.