Skip to content

Commit

Permalink
declare glibc function signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
P403n1x87 committed Jul 25, 2022
1 parent 50d7a25 commit 46cff25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,10 @@ jobs:
valgrind \
gdb
# See (https://github.com/actions/setup-python/issues/442#issuecomment-1167837162)
- name: Temprorary setup-python workaround
run: |
curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi7_3.3-4_amd64.deb
sudo dpkg -i libffi6_3.2.1-8_amd64.deb
sudo ln -sf libffi.so.6.0.4 /usr/lib/x86_64-linux-gnu/libffi.so
sudo dpkg -i libffi7_3.3-4_amd64.deb
sudo ln -sf libffi.so.7.1.0 /lib/x86_64-linux-gnu/libffi.so.7
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}-dev

- name: Install Python 3.10
uses: actions/setup-python@v4
Expand Down
4 changes: 4 additions & 0 deletions test/cunit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def compile(

C = CDLL("libc.so.6")

# https://github.com/actions/setup-python/issues/442#issuecomment-1193140956
C.malloc.restype = ctypes.c_void_p
C.free.argtypes = [ctypes.c_void_p]


class CFunctionDef:
def __init__(self, name: str, args: list[str], rtype: Any) -> None:
Expand Down

0 comments on commit 46cff25

Please sign in to comment.