Commit 86a995bc authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix some C/C++ capi issues

parent 762fe84b
......@@ -90,6 +90,10 @@
#include "warnings.h"
#include "weakrefobject.h"
#ifdef __cplusplus
extern "C" {
#endif
// Pyston additions:
// These new APIS give access to our fast hidden-class-based attributes implementation.
// Ideally in the future this will just be "storage strategy" of dicts and all Python
......@@ -104,7 +108,7 @@ typedef struct _hcattrs PyHcAttrs;
namespace pyston {
class HCAttrs;
}
typedef int PyHcAttrs;
typedef pyston::HCAttrs PyHcAttrs;
#endif
PyAPI_FUNC(void) PyObject_InitHcAttrs(PyHcAttrs*) PYSTON_NOEXCEPT;
PyAPI_FUNC(PyObject*) PyObject_GetAttrWrapper(PyObject*) PYSTON_NOEXCEPT;
......@@ -134,6 +138,10 @@ PyAPI_FUNC(PyObject*) PyGC_RegisterStaticConstant(PyObject*) PYSTON_NOEXCEPT;
PyAPI_FUNC(void) PyGC_Enable() PYSTON_NOEXCEPT;
PyAPI_FUNC(void) PyGC_Disable() PYSTON_NOEXCEPT;
#ifdef __cplusplus
}
#endif
#include "codecs.h"
#include "pyerrors.h"
......
......@@ -1350,7 +1350,7 @@ static void typeSubSetDict(Box* obj, Box* val, void* context) {
abort();
}
extern "C" void PyType_SetDict(PyTypeObject* type, PyObject* dict) {
extern "C" void PyType_SetDict(PyTypeObject* type, PyObject* dict) noexcept {
typeSubSetDict(type, dict, NULL);
type->tp_dict = dict;
}
......@@ -3673,8 +3673,9 @@ int BoxedClosure::clear(Box* _o) noexcept {
#endif
std::vector<Box*> constants;
extern "C" void PyGC_RegisterStaticConstant(Box* b) {
extern "C" PyObject* PyGC_RegisterStaticConstant(Box* b) noexcept {
constants.push_back(b);
return b;
}
extern "C" void _PyUnicode_Fini(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment