mirror of
https://github.com/capnproto/pycapnp.git
synced 2025-03-05 00:41:06 +01:00
Fix problems compiling with gcc4.7
This commit is contained in:
parent
d8bb8206b9
commit
91c1bde833
3 changed files with 23 additions and 21 deletions
|
@ -9,7 +9,7 @@
|
|||
cimport cython
|
||||
cimport capnp_cpp as capnp
|
||||
cimport schema_cpp
|
||||
from capnp_cpp cimport Schema as C_Schema, StructSchema as C_StructSchema, InterfaceSchema as C_InterfaceSchema, DynamicStruct as C_DynamicStruct, DynamicValue as C_DynamicValue, Type as C_Type, DynamicList as C_DynamicList, fixMaybe, getEnumString, SchemaParser as C_SchemaParser, ParsedSchema as C_ParsedSchema, VOID, ArrayPtr, StringPtr, String, StringTree, DynamicOrphan as C_DynamicOrphan, ObjectPointer as C_DynamicObject, WordArrayPtr, DynamicCapability as C_DynamicCapability, new_client, new_server, Request, Response, RemotePromise, convert_to_pypromise, SimpleEventLoop, PyPromise, VoidPromise, CallContext
|
||||
from capnp_cpp cimport Schema as C_Schema, StructSchema as C_StructSchema, InterfaceSchema as C_InterfaceSchema, DynamicStruct as C_DynamicStruct, DynamicValue as C_DynamicValue, Type as C_Type, DynamicList as C_DynamicList, fixMaybe, getEnumString, SchemaParser as C_SchemaParser, ParsedSchema as C_ParsedSchema, VOID, ArrayPtr, StringPtr, String, StringTree, DynamicOrphan as C_DynamicOrphan, ObjectPointer as C_DynamicObject, DynamicCapability as C_DynamicCapability, new_client, new_server, Request, Response, RemotePromise, convert_to_pypromise, SimpleEventLoop, PyPromise, VoidPromise, CallContext
|
||||
|
||||
from schema_cpp cimport Node as C_Node, EnumNode as C_EnumNode
|
||||
from cython.operator cimport dereference as deref
|
||||
|
@ -1720,7 +1720,7 @@ cdef class _FlatArrayMessageReader(_MessageReader):
|
|||
if sz % 8 != 0:
|
||||
raise ValueError("input length must be a multiple of eight bytes")
|
||||
self._object_to_pin = buf
|
||||
self.thisptr = new schema_cpp.FlatArrayMessageReader(capnp.WordArrayPtr(<capnp.word*>ptr, sz//8))
|
||||
self.thisptr = new schema_cpp.FlatArrayMessageReader(schema_cpp.WordArrayPtr(<schema_cpp.word*>ptr, sz//8))
|
||||
|
||||
def _write_message_to_fd(int fd, _MessageBuilder message):
|
||||
"""Serialize a Cap'n Proto message to a file descriptor
|
||||
|
|
|
@ -12,8 +12,6 @@ from libcpp cimport bool as cbool
|
|||
cdef extern from "capnp/common.h" namespace " ::capnp":
|
||||
enum Void:
|
||||
VOID " ::capnp::VOID"
|
||||
cdef cppclass word:
|
||||
pass
|
||||
|
||||
cdef extern from "kj/exception.h" namespace " ::kj":
|
||||
cdef cppclass Exception:
|
||||
|
@ -38,23 +36,11 @@ cdef extern from "kj/common.h" namespace " ::kj":
|
|||
size_t size()
|
||||
T& operator[](size_t index)
|
||||
|
||||
# Cython can't handle ArrayPtr[word] as a function argument
|
||||
cdef cppclass WordArrayPtr "::kj::ArrayPtr<::capnp::word>":
|
||||
WordArrayPtr()
|
||||
WordArrayPtr(word *, size_t size)
|
||||
size_t size()
|
||||
word& operator[](size_t index)
|
||||
|
||||
cdef extern from "kj/array.h" namespace " ::kj":
|
||||
cdef cppclass Array[T]:
|
||||
T* begin()
|
||||
size_t size()
|
||||
|
||||
# Cython can't handle Array[word] as a function argument
|
||||
cdef cppclass WordArray "::kj::Array<::capnp::word>":
|
||||
word* begin()
|
||||
size_t size()
|
||||
|
||||
cdef extern from "capnp/schema.h" namespace " ::capnp":
|
||||
cdef cppclass Schema:
|
||||
Node.Reader getProto() except +
|
||||
|
@ -194,7 +180,6 @@ cdef extern from "fixMaybe.h":
|
|||
char * getEnumString(DynamicStruct.Builder val)
|
||||
char * getEnumString(Request val)
|
||||
|
||||
|
||||
cdef extern from "capabilityHelper.h":
|
||||
PyPromise evalLater(EventLoop &, PyObject * func)
|
||||
PyPromise there(EventLoop & loop, PyPromise & promise, PyObject * func, PyObject * error_func)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
from libc.stdint cimport *
|
||||
from capnp_cpp cimport DynamicOrphan
|
||||
cimport capnp_cpp
|
||||
ctypedef unsigned int uint
|
||||
ctypedef uint8_t UInt8
|
||||
ctypedef uint16_t UInt16
|
||||
|
@ -691,18 +690,36 @@ cdef extern from "capnp/message.h" namespace " ::capnp":
|
|||
enum Void:
|
||||
VOID
|
||||
|
||||
cdef extern from "capnp/common.h" namespace " ::capnp":
|
||||
cdef cppclass word:
|
||||
pass
|
||||
|
||||
cdef extern from "kj/common.h" namespace " ::kj":
|
||||
# Cython can't handle ArrayPtr[word] as a function argument
|
||||
cdef cppclass WordArrayPtr " ::kj::ArrayPtr< ::capnp::word>":
|
||||
WordArrayPtr()
|
||||
WordArrayPtr(word *, size_t size)
|
||||
size_t size()
|
||||
word& operator[](size_t index)
|
||||
|
||||
cdef extern from "kj/array.h" namespace " ::kj":
|
||||
# Cython can't handle Array[word] as a function argument
|
||||
cdef cppclass WordArray " ::kj::Array< ::capnp::word>":
|
||||
word* begin()
|
||||
size_t size()
|
||||
|
||||
cdef extern from "capnp/serialize.h" namespace " ::capnp":
|
||||
cdef cppclass StreamFdMessageReader(MessageReader):
|
||||
StreamFdMessageReader(int) except +
|
||||
StreamFdMessageReader(int, ReaderOptions) except +
|
||||
|
||||
cdef cppclass FlatArrayMessageReader(MessageReader):
|
||||
FlatArrayMessageReader(capnp_cpp.WordArrayPtr array) except +
|
||||
FlatArrayMessageReader(capnp_cpp.WordArrayPtr array, ReaderOptions) except +
|
||||
FlatArrayMessageReader(WordArrayPtr array) except +
|
||||
FlatArrayMessageReader(WordArrayPtr array, ReaderOptions) except +
|
||||
|
||||
void writeMessageToFd(int, MessageBuilder&) except +
|
||||
|
||||
capnp_cpp.WordArray messageToFlatArray(MessageBuilder &)
|
||||
WordArray messageToFlatArray(MessageBuilder &)
|
||||
|
||||
cdef extern from "capnp/serialize-packed.h" namespace " ::capnp":
|
||||
cdef cppclass PackedFdMessageReader(MessageReader):
|
||||
|
|
Loading…
Add table
Reference in a new issue