File: common.h

package info (click to toggle)
python-msgspec 0.19.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,356 kB
  • sloc: javascript: 23,944; ansic: 20,540; python: 20,465; makefile: 29; sh: 19
file content (23 lines) | stat: -rw-r--r-- 526 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef MS_COMMON_H
#define MS_COMMON_H

#ifdef __GNUC__
#define MS_LIKELY(pred) __builtin_expect(!!(pred), 1)
#define MS_UNLIKELY(pred) __builtin_expect(!!(pred), 0)
#else
#define MS_LIKELY(pred) (pred)
#define MS_UNLIKELY(pred) (pred)
#endif

#ifdef __GNUC__
#define MS_INLINE __attribute__((always_inline)) inline
#define MS_NOINLINE __attribute__((noinline))
#elif defined(_MSC_VER)
#define MS_INLINE __forceinline
#define MS_NOINLINE __declspec(noinline)
#else
#define MS_INLINE inline
#define MS_NOINLINE
#endif

#endif