forked from GitHub/gf-core
Fix compilation errors of Python bindings on macOS
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Python bindings to C runtime
|
# Python bindings to C runtime
|
||||||
|
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
These bindings do not support Python 2. Python 3 is assumed in all these instructions.
|
||||||
|
|
||||||
## Pre-requisites
|
## Pre-requisites
|
||||||
|
|
||||||
1. You must have installed the PGF C runtime (see `../c/README.md`)
|
1. You must have installed the PGF C runtime (see `../c/README.md`)
|
||||||
@@ -26,10 +30,3 @@ pytest
|
|||||||
```
|
```
|
||||||
|
|
||||||
Requires: `pip install 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
|
PyObject *exprs; // PyTupleObject of ExprObject
|
||||||
} TypeObject;
|
} TypeObject;
|
||||||
|
|
||||||
PyTypeObject pgf_TypeType;
|
extern PyTypeObject pgf_TypeType;
|
||||||
|
|
||||||
// typedef struct {
|
// typedef struct {
|
||||||
// PyObject_HEAD
|
// PyObject_HEAD
|
||||||
@@ -72,14 +72,14 @@ typedef struct {
|
|||||||
ExprObject *expr;
|
ExprObject *expr;
|
||||||
} ExprImplArgObject;
|
} ExprImplArgObject;
|
||||||
|
|
||||||
PyTypeObject pgf_ExprType;
|
extern PyTypeObject pgf_ExprType;
|
||||||
PyTypeObject pgf_ExprAbsType;
|
extern PyTypeObject pgf_ExprAbsType;
|
||||||
PyTypeObject pgf_ExprAppType;
|
extern PyTypeObject pgf_ExprAppType;
|
||||||
PyTypeObject pgf_ExprLitType;
|
extern PyTypeObject pgf_ExprLitType;
|
||||||
PyTypeObject pgf_ExprMetaType;
|
extern PyTypeObject pgf_ExprMetaType;
|
||||||
PyTypeObject pgf_ExprFunType;
|
extern PyTypeObject pgf_ExprFunType;
|
||||||
PyTypeObject pgf_ExprVarType;
|
extern PyTypeObject pgf_ExprVarType;
|
||||||
PyTypeObject pgf_ExprTypedType;
|
extern PyTypeObject pgf_ExprTypedType;
|
||||||
PyTypeObject pgf_ExprImplArgType;
|
extern PyTypeObject pgf_ExprImplArgType;
|
||||||
|
|
||||||
#endif // PYPGF_EXPR_H_
|
#endif // PYPGF_EXPR_H_
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ typedef struct {
|
|||||||
PgfRevision revision;
|
PgfRevision revision;
|
||||||
} PGFObject;
|
} PGFObject;
|
||||||
|
|
||||||
PyObject *PGFError;
|
extern PyObject *PGFError;
|
||||||
PgfExnType handleError(PgfExn err);
|
PgfExnType handleError(PgfExn err);
|
||||||
|
|
||||||
PgfText *CString_AsPgfText(const char *s, size_t size);
|
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 FreeHypos(PgfTypeHypo *hypos, Py_ssize_t n_hypos);
|
||||||
void FreePgfPrintContext(PgfPrintContext *ctxt);
|
void FreePgfPrintContext(PgfPrintContext *ctxt);
|
||||||
|
|
||||||
PgfUnmarshaller unmarshaller;
|
extern PgfUnmarshaller unmarshaller;
|
||||||
PgfMarshaller marshaller;
|
extern PgfMarshaller marshaller;
|
||||||
|
|
||||||
#endif // PYPGF_FFI_H_
|
#endif // PYPGF_FFI_H_
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ typedef struct {
|
|||||||
PgfRevision revision; // transient branch
|
PgfRevision revision; // transient branch
|
||||||
} TransactionObject;
|
} TransactionObject;
|
||||||
|
|
||||||
PyTypeObject pgf_TransactionType;
|
extern PyTypeObject pgf_TransactionType;
|
||||||
|
|
||||||
PyObject *PGF_checkoutBranch(PGFObject *self, PyObject *args);
|
PyObject *PGF_checkoutBranch(PGFObject *self, PyObject *args);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user