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

Rename if_re_bsd.h and rtlhw.cpp to match BSD driver #5

Open
wants to merge 1 commit into
base: bsd
Choose a base branch
from

Conversation

idigdoug
Copy link
Collaborator

@idigdoug idigdoug commented Nov 4, 2024

To make it easier to relate the BSD driver sources to the Windows driver sources, restore the original BSD driver filenames:

  • rtlhw.cpp -> if_re.c
  • if_re_bsd.h -> if_rereg.h

Also, compile the BSD sources using C rules instead of C++ rules, which hopefully make it easier to keep the BSD and Windows code aligned.

Compiling as C code requires a few fixes:

  • Functions shared between C and C++ code need to be compiled as extern "C".
  • To use bool in C code, you have to include the stdbool.h header.
  • During the build, the compiler can't use the same .pch for both C and C++ code, so only "precompile" the header for the C++ code (compile the C code without precompiled header acceleration).

To make it easier to relate the BSD driver sources to the Windows driver
sources, restore the original BSD driver filenames:

- `rtlhw.cpp` -> `if_re.c`
- `if_re_bsd.h` -> `if_rereg.h`

Also, compile the BSD sources using C rules instead of C++ rules, which
hopefully make it easier to keep the BSD and Windows code aligned.

Compiling as C code requires a few fixes:

- Functions shared between C and C++ code need to be compiled as `extern
  "C"`.
- To use `bool` in C code, you have to include the `stdbool.h` header.
- During the build, the compiler can't use the same .pch for both C and
  C++ code, so only "precompile" the header for the C++ code (compile
  the C code without precompiled header acceleration).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant