mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-10 13:29:32 -06:00
Fix compilation errors of Python bindings on macOS
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Python bindings to C runtime
|
||||
|
||||
## Compatibility
|
||||
|
||||
These bindings do not support Python 2. Python 3 is assumed in all these instructions.
|
||||
|
||||
## Pre-requisites
|
||||
|
||||
1. You must have installed the PGF C runtime (see `../c/README.md`)
|
||||
@@ -26,10 +30,3 @@ pytest
|
||||
```
|
||||
|
||||
Requires: `pip install pytest`
|
||||
|
||||
|
||||
## Debugging
|
||||
|
||||
valgrind --leak-check=full --show-leak-kinds=all pytest 2> valgrind.txt
|
||||
|
||||
valgrind --leak-check=full --show-leak-kinds=all -- python -c 'import pgf; s = pgf.readType("A -> B"); print(s)' 2> valgrind.txt
|
||||
|
||||
@@ -13,7 +13,7 @@ typedef struct {
|
||||
PyObject *exprs; // PyTupleObject of ExprObject
|
||||
} TypeObject;
|
||||
|
||||
PyTypeObject pgf_TypeType;
|
||||
extern PyTypeObject pgf_TypeType;
|
||||
|
||||
// typedef struct {
|
||||
// PyObject_HEAD
|
||||
@@ -72,14 +72,14 @@ typedef struct {
|
||||
ExprObject *expr;
|
||||
} ExprImplArgObject;
|
||||
|
||||
PyTypeObject pgf_ExprType;
|
||||
PyTypeObject pgf_ExprAbsType;
|
||||
PyTypeObject pgf_ExprAppType;
|
||||
PyTypeObject pgf_ExprLitType;
|
||||
PyTypeObject pgf_ExprMetaType;
|
||||
PyTypeObject pgf_ExprFunType;
|
||||
PyTypeObject pgf_ExprVarType;
|
||||
PyTypeObject pgf_ExprTypedType;
|
||||
PyTypeObject pgf_ExprImplArgType;
|
||||
extern PyTypeObject pgf_ExprType;
|
||||
extern PyTypeObject pgf_ExprAbsType;
|
||||
extern PyTypeObject pgf_ExprAppType;
|
||||
extern PyTypeObject pgf_ExprLitType;
|
||||
extern PyTypeObject pgf_ExprMetaType;
|
||||
extern PyTypeObject pgf_ExprFunType;
|
||||
extern PyTypeObject pgf_ExprVarType;
|
||||
extern PyTypeObject pgf_ExprTypedType;
|
||||
extern PyTypeObject pgf_ExprImplArgType;
|
||||
|
||||
#endif // PYPGF_EXPR_H_
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef struct {
|
||||
PgfRevision revision;
|
||||
} PGFObject;
|
||||
|
||||
PyObject *PGFError;
|
||||
extern PyObject *PGFError;
|
||||
PgfExnType handleError(PgfExn err);
|
||||
|
||||
PgfText *CString_AsPgfText(const char *s, size_t size);
|
||||
@@ -29,7 +29,7 @@ void FreePgfText(PgfText *txt);
|
||||
void FreeHypos(PgfTypeHypo *hypos, Py_ssize_t n_hypos);
|
||||
void FreePgfPrintContext(PgfPrintContext *ctxt);
|
||||
|
||||
PgfUnmarshaller unmarshaller;
|
||||
PgfMarshaller marshaller;
|
||||
extern PgfUnmarshaller unmarshaller;
|
||||
extern PgfMarshaller marshaller;
|
||||
|
||||
#endif // PYPGF_FFI_H_
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef struct {
|
||||
PgfRevision revision; // transient branch
|
||||
} TransactionObject;
|
||||
|
||||
PyTypeObject pgf_TransactionType;
|
||||
extern PyTypeObject pgf_TransactionType;
|
||||
|
||||
PyObject *PGF_checkoutBranch(PGFObject *self, PyObject *args);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user