diff --git a/include/pocketpy/export.h b/include/pocketpy/export.h index 44104bae..3e959b3b 100644 --- a/include/pocketpy/export.h +++ b/include/pocketpy/export.h @@ -65,7 +65,7 @@ #ifdef NDEBUG #if defined(__GNUC__) #define PK_INLINE __attribute__((always_inline)) inline - #elif defined(_MSC_VER) + #elif defined(_MSC_VER) && !defined(__clang__) #define PK_INLINE __forceinline #else #define PK_INLINE inline diff --git a/src/common/chunkedvector.c b/src/common/chunkedvector.c index b60c8404..f965c32b 100644 --- a/src/common/chunkedvector.c +++ b/src/common/chunkedvector.c @@ -6,7 +6,7 @@ #include #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__)) return x == 0 ? 0 : (int)sizeof(unsigned long) * 8 - __builtin_clzl(x); #elif defined(_MSC_VER) diff --git a/src/interpreter/typeinfo.c b/src/interpreter/typeinfo.c index bb24245a..a20b76ce 100644 --- a/src/interpreter/typeinfo.c +++ b/src/interpreter/typeinfo.c @@ -11,7 +11,7 @@ py_ItemRef pk_tpfindname(py_TypeInfo* ti, py_Name name) { return NULL; } -extern PK_INLINE py_TypeInfo* pk_typeinfo(py_Type type) { +PK_INLINE py_TypeInfo* pk_typeinfo(py_Type type) { #ifndef NDEBUG int length = pk_current_vm->types.length; if(type <= 0 || type >= length) { diff --git a/src/objects/object.c b/src/objects/object.c index 3625910d..1a3f7ef4 100644 --- a/src/objects/object.c +++ b/src/objects/object.c @@ -2,16 +2,16 @@ #include "pocketpy/pocketpy.h" #include -extern PK_INLINE void* PyObject__userdata(PyObject* self) { +PK_INLINE void* PyObject__userdata(PyObject* self) { 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); 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); return (py_TValue*)(self->flex); } \ No newline at end of file