Find all C/C++ source files in the `folder` directory.

def get_c_sources(folder, include_headers=False):
    """Find all C/C++ source files in the `folder` directory."""
    allowed_extensions = [".c", ".C", ".cc", ".cpp", ".cxx", ".c++"]
    if include_headers:
        allowed_extensions += [".h", ".hpp"]
    sources = []
    for root, _, files in os.walk(folder):
        for name in files:
            ext = os.path.splitext(name)[1]
            if name == "types.cc":
                # Make sure `types.cc` is compiled first, as it has multiple
                # useful static assertions.
                sources.insert(0, os.path.join(root, name))
            elif ext in allowed_extensions:
                sources.append(os.path.join(root, name))
    return sources