diff --git a/golang/_golang.pxd b/golang/_golang.pxd index 41a2953be8349d336eedd815d10942d2f0174930..2e2402556eeb2834fe2e05bf872c2306a05ecdb5 100644 --- a/golang/_golang.pxd +++ b/golang/_golang.pxd @@ -1,5 +1,5 @@ # cython: language_level=2 -# Copyright (C) 2019-2022 Nexedi SA and Contributors. +# Copyright (C) 2019-2023 Nexedi SA and Contributors. # Kirill Smelkov <kirr@nexedi.com> # # This program is free software: you can Use, Study, Modify and Redistribute @@ -65,6 +65,9 @@ cdef extern from *: # on the edge of Python/nogil world. from libcpp.string cimport string # golang::string = std::string cdef extern from "golang/libgolang.h" namespace "golang" nogil: + ctypedef unsigned char byte + ctypedef signed int rune # = int32 + void panic(const char *) const char *recover() diff --git a/golang/libgolang.h b/golang/libgolang.h index b9f5ec6c9a0b9e12d65ad12e86bb7ccfb72dcde4..c52b689a1675edb4f6fdc1088d4b66a02ba7a445 100644 --- a/golang/libgolang.h +++ b/golang/libgolang.h @@ -438,6 +438,10 @@ constexpr Nil nil = nullptr; // string is alias for std::string. using string = std::string; +// byte/rune types related to string. +using byte = uint8_t; +using rune = int32_t; + // func is alias for std::function. template<typename F> using func = std::function<F>;