From 7990a2d4ceda10e5063554f8359afad66a3a7666 Mon Sep 17 00:00:00 2001 From: Luke Craig Date: Mon, 21 Oct 2024 15:15:02 -0400 Subject: [PATCH] ignore ifdefs in source pypanda --- panda/python/core/create_panda_datatypes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/python/core/create_panda_datatypes.py b/panda/python/core/create_panda_datatypes.py index 5d7f1b1e501..5f86c2c14fa 100755 --- a/panda/python/core/create_panda_datatypes.py +++ b/panda/python/core/create_panda_datatypes.py @@ -96,6 +96,9 @@ def copy_ppp_header(filename): subcontents = trim_pypanda(contents) for line in subcontents.split("\n"): # now add void ppp_add_cb_{cb_name}({cb_name}_t); + forbidden = ["#ifndef", "#endif"] + if any(i in line for i in forbidden): + continue m = reg.match(line) if m: ret_type = m.groups(1)[0] @@ -229,6 +232,7 @@ def expand_ppp_def(line): ffi.cdef("typedef int target_pid_t;") ffi.cdef("typedef uint"+str(bits)+"_t target_ulong;") + ffi.cdef("typedef uint"+str(bits)+"_t target_ptr_t;") ffi.cdef("typedef int"+str(bits)+"_t target_long;") # PPP Headers