Skip to content

Instantly share code, notes, and snippets.

@mobius
Created March 20, 2012 01:28
Show Gist options
  • Save mobius/2129596 to your computer and use it in GitHub Desktop.
Save mobius/2129596 to your computer and use it in GitHub Desktop.
forceinline defines
#ifndef FORCEINLINE
#if defined(__GNUC__)
#define FORCEINLINE __inline __attribute__ ((always_inline))
#elif defined(_MSC_VER)
#define FORCEINLINE __forceinline
#endif
#endif
#ifndef NOINLINE
#if defined(__GNUC__)
#define NOINLINE __attribute__ ((noinline))
#elif defined(_MSC_VER)
#define NOINLINE __declspec(noinline)
#else
#define NOINLINE
#endif
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment