Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate extern wrappers for inlined functions #2335

Merged
merged 37 commits into from
Feb 7, 2023

Commits on Jan 24, 2023

  1. Generate extern wrappers for inlined functions

    If bindgen finds an inlined function and the
    `--generate-extern-functions` options is enabled, then:
    
    - It will generate two new source and header files with external
      functions that wrap the inlined functions.
    - Rerun `Bindings::generate` using the new header file to include these
      wrappers in the generated bindings.
    
    The following additional options were added:
    - `--extern-function-suffix=<suffix>`: Adds <suffix> to the name of each
      external wrapper function (`__extern` is used by default).
    - `--extern-functions-file-name=<name>`: Uses <name> as the file name
      for the header and source files (`extern` is used by default).
    - `--extern-function-directory=<dir>`: Creates the source and header
      files inside <dir> (`/tmp/bindgen` is used by default).
    
    The C code serialization is experimental and only supports a very
    limited set of C functions.
    
    Fixes rust-lang#1090.
    pvdrz committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    afbc4d8 View commit details
    Browse the repository at this point in the history
  2. add(static inlined): tests

    test(static inlined): pretty print the diff
    
    Issue: rust-langGH-1090
    
    test(static inlined): refactor paths once again
    
    - Because directory structure is confusing to the author of this commit
    
    rust-langGH-1090
    
    test(static inlined): refactor test files
    
    - Expected files should be under tests/expectations/generated
    - Remove extern_stub.h because we can reuse the header from generate-extern-functions.h
    
    test(static inlined): diff test; generated files
    
    refactor(static inlined): integration test
    
    Issue: rust-langGH-1090
    
    rust-langGH-1090: Integration tests
    
    integration test: document the GH issue
    
    integration test (macro): same order in impl as the trait for consistency
    
    integration test: move each setup into its own function, just to save face
    
    inline static func integration test
    
    resolve accidental conflict
    amanjeev authored and pvdrz committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    ad0f161 View commit details
    Browse the repository at this point in the history
  3. add the experimental feature

    pvdrz committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    101cde0 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2023

  1. Rename options

    pvdrz committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    61b2b44 View commit details
    Browse the repository at this point in the history
  2. Fixup: Rename options

    pvdrz committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    65a80e0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    eb823b8 View commit details
    Browse the repository at this point in the history
  4. avoid second run

    pvdrz committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    8b0bdcd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    39ac21b View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2023

  1. some nits

    pvdrz committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    fa47c2b View commit details
    Browse the repository at this point in the history
  2. update docs and remove headers

    pvdrz committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    e33237b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d65527f View commit details
    Browse the repository at this point in the history
  4. rename non-extern to static

    pvdrz committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    c80ed2d View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2023

  1. Remove headers

    pvdrz committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    9ecbde4 View commit details
    Browse the repository at this point in the history
  2. update integration tests

    pvdrz committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    34278f4 View commit details
    Browse the repository at this point in the history
  3. run rustfmt

    pvdrz committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    eb2a3d3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    595ce78 View commit details
    Browse the repository at this point in the history
  5. use static kind

    pvdrz committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    cb93924 View commit details
    Browse the repository at this point in the history
  6. force function names

    pvdrz committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    e36e088 View commit details
    Browse the repository at this point in the history
  7. refactor c serialization

    pvdrz committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    ceebca1 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2023

  1. Configuration menu
    Copy the full SHA
    f7df058 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c55aa5b View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2023

  1. Configuration menu
    Copy the full SHA
    c12645f View commit details
    Browse the repository at this point in the history
  2. add missing space

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    3eb7f69 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b682c6c View commit details
    Browse the repository at this point in the history
  4. fix test

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    6721b96 View commit details
    Browse the repository at this point in the history
  5. add support for Comp types

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    ab6ea25 View commit details
    Browse the repository at this point in the history
  6. run rustfmt

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    bc7f6bf View commit details
    Browse the repository at this point in the history
  7. support char

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    e823b32 View commit details
    Browse the repository at this point in the history
  8. add Extra associated type

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    0aafbee View commit details
    Browse the repository at this point in the history
  9. 2 Configuration menu
    Copy the full SHA
    58f740d View commit details
    Browse the repository at this point in the history
  10. fix tests and remove dbg

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    affcb2f View commit details
    Browse the repository at this point in the history
  11. run rustfmt

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    4819ea4 View commit details
    Browse the repository at this point in the history
  12. handle type aliases

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    7b8fe72 View commit details
    Browse the repository at this point in the history
  13. handle constness

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    7698c71 View commit details
    Browse the repository at this point in the history
  14. use void for empty args

    pvdrz committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    9326863 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2023

  1. pass amanfmt :trollface:

    pvdrz committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    5a9e5ca View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2023

  1. some nits

    pvdrz committed Feb 7, 2023
    Configuration menu
    Copy the full SHA
    572d1a4 View commit details
    Browse the repository at this point in the history