Commit 7b77a513 authored by Andrew Gallagher's avatar Andrew Gallagher Committed by Facebook Github Bot

folly/portability: move some macro definitions to `CPortability.h`

Summary: These macros apply to both C and C++.

Reviewed By: yfeldblum

Differential Revision: D4199905

fbshipit-source-id: 8dc22959d0a6349c6c76415d1a38eda52cab83a5
parent ace896f3
...@@ -107,3 +107,21 @@ ...@@ -107,3 +107,21 @@
#else #else
# define FOLLY_EXPORT # define FOLLY_EXPORT
#endif #endif
// noinline
#ifdef _MSC_VER
# define FOLLY_NOINLINE __declspec(noinline)
#elif defined(__clang__) || defined(__GNUC__)
# define FOLLY_NOINLINE __attribute__((__noinline__))
#else
# define FOLLY_NOINLINE
#endif
// always inline
#ifdef _MSC_VER
# define FOLLY_ALWAYS_INLINE __forceinline
#elif defined(__clang__) || defined(__GNUC__)
# define FOLLY_ALWAYS_INLINE inline __attribute__((__always_inline__))
#else
# define FOLLY_ALWAYS_INLINE inline
#endif
...@@ -74,24 +74,6 @@ constexpr bool kHasUnalignedAccess = false; ...@@ -74,24 +74,6 @@ constexpr bool kHasUnalignedAccess = false;
# define FOLLY_DEPRECATED(msg) # define FOLLY_DEPRECATED(msg)
#endif #endif
// noinline
#ifdef _MSC_VER
# define FOLLY_NOINLINE __declspec(noinline)
#elif defined(__clang__) || defined(__GNUC__)
# define FOLLY_NOINLINE __attribute__((__noinline__))
#else
# define FOLLY_NOINLINE
#endif
// always inline
#ifdef _MSC_VER
# define FOLLY_ALWAYS_INLINE __forceinline
#elif defined(__clang__) || defined(__GNUC__)
# define FOLLY_ALWAYS_INLINE inline __attribute__((__always_inline__))
#else
# define FOLLY_ALWAYS_INLINE inline
#endif
// warn unused result // warn unused result
#if defined(_MSC_VER) && (_MSC_VER >= 1700) #if defined(_MSC_VER) && (_MSC_VER >= 1700)
#define FOLLY_WARN_UNUSED_RESULT _Check_return_ #define FOLLY_WARN_UNUSED_RESULT _Check_return_
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment