mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-27 09:50:20 +01:00
Tested-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
33 lines
732 B
C
33 lines
732 B
C
#ifndef _U_COMPILER_H_
|
|
#define _U_COMPILER_H_
|
|
|
|
#include "c99_compat.h" /* inline, __func__, etc. */
|
|
|
|
|
|
/* XXX: Use standard `inline` keyword instead */
|
|
#ifndef INLINE
|
|
# define INLINE inline
|
|
#endif
|
|
|
|
/* Function visibility */
|
|
#ifndef PUBLIC
|
|
# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
|
# define PUBLIC __attribute__((visibility("default")))
|
|
# elif defined(_MSC_VER)
|
|
# define PUBLIC __declspec(dllexport)
|
|
# else
|
|
# define PUBLIC
|
|
# endif
|
|
#endif
|
|
|
|
#ifndef likely
|
|
# if defined(__GNUC__)
|
|
# define likely(x) __builtin_expect(!!(x), 1)
|
|
# define unlikely(x) __builtin_expect(!!(x), 0)
|
|
# else
|
|
# define likely(x) (x)
|
|
# define unlikely(x) (x)
|
|
# endif
|
|
#endif
|
|
|
|
#endif /* _U_COMPILER_H_ */
|