Add accesible version numbers for C++ libcapnp
This commit is contained in:
@@ -12,6 +12,12 @@ cdef extern from "capnp/common.h" namespace " ::capnp":
|
|||||||
enum Void:
|
enum Void:
|
||||||
VOID " ::capnp::VOID"
|
VOID " ::capnp::VOID"
|
||||||
|
|
||||||
|
cdef extern from "capnp/common.h":
|
||||||
|
int CAPNP_VERSION_MAJOR
|
||||||
|
int CAPNP_VERSION_MINOR
|
||||||
|
int CAPNP_VERSION_MICRO
|
||||||
|
int CAPNP_VERSION
|
||||||
|
|
||||||
cdef extern from "kj/string.h" namespace " ::kj":
|
cdef extern from "kj/string.h" namespace " ::kj":
|
||||||
cdef cppclass StringPtr:
|
cdef cppclass StringPtr:
|
||||||
StringPtr()
|
StringPtr()
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ import threading as _threading
|
|||||||
import socket as _socket
|
import socket as _socket
|
||||||
import random as _random
|
import random as _random
|
||||||
|
|
||||||
|
_CAPNP_VERSION_MAJOR = capnp.CAPNP_VERSION_MAJOR
|
||||||
|
_CAPNP_VERSION_MINOR = capnp.CAPNP_VERSION_MINOR
|
||||||
|
_CAPNP_VERSION_MICRO = capnp.CAPNP_VERSION_MICRO
|
||||||
|
_CAPNP_VERSION = capnp.CAPNP_VERSION
|
||||||
|
|
||||||
# By making it public, we'll be able to call it from capabilityHelper.h
|
# By making it public, we'll be able to call it from capabilityHelper.h
|
||||||
cdef public object wrap_dynamic_struct_reader(Response & r):
|
cdef public object wrap_dynamic_struct_reader(Response & r):
|
||||||
return _Response()._init_childptr(new Response(moveResponse(r)), None)
|
return _Response()._init_childptr(new Response(moveResponse(r)), None)
|
||||||
|
|||||||
5
setup.py
5
setup.py
@@ -25,6 +25,11 @@ def write_version_py(filename=None):
|
|||||||
cnt = """\
|
cnt = """\
|
||||||
version = '%s'
|
version = '%s'
|
||||||
short_version = '%s'
|
short_version = '%s'
|
||||||
|
|
||||||
|
from .lib.capnp import _CAPNP_VERSION_MAJOR as LIBCAPNP_VERSION_MAJOR
|
||||||
|
from .lib.capnp import _CAPNP_VERSION_MINOR as LIBCAPNP_VERSION_MINOR
|
||||||
|
from .lib.capnp import _CAPNP_VERSION_MICRO as LIBCAPNP_VERSION_MICRO
|
||||||
|
from .lib.capnp import _CAPNP_VERSION as LIBCAPNP_VERSION
|
||||||
"""
|
"""
|
||||||
if not filename:
|
if not filename:
|
||||||
filename = os.path.join(
|
filename = os.path.join(
|
||||||
|
|||||||
Reference in New Issue
Block a user