Browse Source

Add DUK_HOT and DUK_COLD attribute macros

pull/1297/head
Sami Vaarala 8 years ago
parent
commit
33727d3009
  1. 3
      config/compilers/compiler_clang.h.in
  2. 6
      config/compilers/compiler_gcc.h.in
  3. 7
      config/header-snippets/compiler_fillins.h.in

3
config/compilers/compiler_clang.h.in

@ -29,6 +29,9 @@
#define DUK_ALWAYS_INLINE inline __attribute__((always_inline))
#endif
/* DUK_HOT */
/* DUK_COLD */
#if defined(DUK_F_DLL_BUILD) && defined(DUK_F_WINDOWS)
#snippet "msvc_visibility.h.in"
#else

6
config/compilers/compiler_gcc.h.in

@ -33,6 +33,12 @@
#define DUK_ALWAYS_INLINE inline __attribute__((always_inline))
#endif
#if (defined(DUK_F_C99) || defined(DUK_F_CPP11)) && \
defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40300)
#define DUK_HOT __attribute__((hot))
#define DUK_COLD __attribute__((cold))
#endif
#if defined(DUK_F_DLL_BUILD) && defined(DUK_F_WINDOWS)
#snippet "msvc_visibility.h.in"
#elif defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40000)

7
config/header-snippets/compiler_fillins.h.in

@ -80,6 +80,13 @@
#define DUK_ALWAYS_INLINE /*nop*/
#endif
#if !defined(DUK_HOT)
#define DUK_HOT /*nop*/
#endif
#if !defined(DUK_COLD)
#define DUK_COLD /*nop*/
#endif
#if !defined(DUK_EXTERNAL_DECL)
#define DUK_EXTERNAL_DECL extern
#endif

Loading…
Cancel
Save