mirror of
https://github.com/pocketpy/pocketpy
synced 2026-02-13 19:10:16 +00:00
Force clang-cl to use inline instead of __forceinline
This commit is contained in:
parent
8d911452bc
commit
db6f1109f3
@ -65,7 +65,7 @@
|
|||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#define PK_INLINE __attribute__((always_inline)) inline
|
#define PK_INLINE __attribute__((always_inline)) inline
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER) && !defined(__clang__)
|
||||||
#define PK_INLINE __forceinline
|
#define PK_INLINE __forceinline
|
||||||
#else
|
#else
|
||||||
#define PK_INLINE inline
|
#define PK_INLINE inline
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern PK_INLINE int c11__bit_length(unsigned long x) {
|
PK_INLINE int c11__bit_length(unsigned long x) {
|
||||||
#if(defined(__clang__) || defined(__GNUC__))
|
#if(defined(__clang__) || defined(__GNUC__))
|
||||||
return x == 0 ? 0 : (int)sizeof(unsigned long) * 8 - __builtin_clzl(x);
|
return x == 0 ? 0 : (int)sizeof(unsigned long) * 8 - __builtin_clzl(x);
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
|
|||||||
@ -11,7 +11,7 @@ py_ItemRef pk_tpfindname(py_TypeInfo* ti, py_Name name) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern PK_INLINE py_TypeInfo* pk_typeinfo(py_Type type) {
|
PK_INLINE py_TypeInfo* pk_typeinfo(py_Type type) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
int length = pk_current_vm->types.length;
|
int length = pk_current_vm->types.length;
|
||||||
if(type <= 0 || type >= length) {
|
if(type <= 0 || type >= length) {
|
||||||
|
|||||||
@ -2,16 +2,16 @@
|
|||||||
#include "pocketpy/pocketpy.h"
|
#include "pocketpy/pocketpy.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
extern PK_INLINE void* PyObject__userdata(PyObject* self) {
|
PK_INLINE void* PyObject__userdata(PyObject* self) {
|
||||||
return self->flex + PK_OBJ_SLOTS_SIZE(self->slots);
|
return self->flex + PK_OBJ_SLOTS_SIZE(self->slots);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern PK_INLINE NameDict* PyObject__dict(PyObject* self) {
|
PK_INLINE NameDict* PyObject__dict(PyObject* self) {
|
||||||
assert(self->slots == -1);
|
assert(self->slots == -1);
|
||||||
return (NameDict*)(self->flex);
|
return (NameDict*)(self->flex);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern PK_INLINE py_TValue* PyObject__slots(PyObject* self) {
|
PK_INLINE py_TValue* PyObject__slots(PyObject* self) {
|
||||||
assert(self->slots >= 0);
|
assert(self->slots >= 0);
|
||||||
return (py_TValue*)(self->flex);
|
return (py_TValue*)(self->flex);
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user