| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
#ifndef __PJ_COMPAT_CC_CLANG_H__ |
| 19 |
#define __PJ_COMPAT_CC_CLANG_H__ |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#ifndef __clang__ |
| 27 |
# error "This file is only for clang!" |
| 28 |
#endif |
| 29 |
|
| 30 |
#define PJ_CC_NAME "clang" |
| 31 |
#define PJ_CC_VER_1 __clang_major__ |
| 32 |
#define PJ_CC_VER_2 __clang_minor__ |
| 33 |
#define PJ_CC_VER_3 __clang_patchlevel__ |
| 34 |
|
| 35 |
#define PJ_THREAD_FUNC |
| 36 |
#define PJ_NORETURN |
| 37 |
|
| 38 |
#define PJ_HAS_INT64 1 |
| 39 |
|
| 40 |
#ifdef __STRICT_ANSI__ |
| 41 |
#include <inttypes.h> |
| 42 |
typedef int64_t pj_int64_t; |
| 43 |
typedef uint64_t pj_uint64_t; |
| 44 |
#define PJ_INLINE_SPECIFIER static __inline |
| 45 |
#define PJ_ATTR_NORETURN |
| 46 |
#define PJ_ATTR_MAY_ALIAS |
| 47 |
#else |
| 48 |
typedef long long pj_int64_t; |
| 49 |
typedef unsigned long long pj_uint64_t; |
| 50 |
#define PJ_INLINE_SPECIFIER static inline |
| 51 |
|
| 52 |
#if defined(__has_feature) && __has_feature(address_sanitizer) && \ |
| 53 |
defined(__APPLE__) && defined(__aarch64__) |
| 54 |
#define PJ_ATTR_NORETURN |
| 55 |
#else |
| 56 |
#define PJ_ATTR_NORETURN __attribute__ ((noreturn)) |
| 57 |
#endif |
| 58 |
#define PJ_ATTR_MAY_ALIAS __attribute__((__may_alias__)) |
| 59 |
#endif |
| 60 |
|
| 61 |
#define PJ_INT64(val) val##LL |
| 62 |
#define PJ_UINT64(val) val##ULL |
| 63 |
#define PJ_INT64_FMT "L" |
| 64 |
|
| 65 |
|
| 66 |
#define PJ_UNREACHED(x) |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
#define PJ_ALIGN_DATA_PREFIX(alignment) |
| 77 |
#define PJ_ALIGN_DATA_SUFFIX(alignment) __attribute__((aligned (alignment))) |
| 78 |
#define PJ_ALIGN_DATA(declaration, alignment) PJ_ALIGN_DATA_PREFIX(alignment) declaration PJ_ALIGN_DATA_SUFFIX(alignment) |
| 79 |
|
| 80 |
#endif |