machinekit-hal icon indicating copy to clipboard operation
machinekit-hal copied to clipboard

Namespaced includes of libraries

Open cerna opened this issue 4 years ago • 0 comments

This is part of tackling of issue #200, of which the progress can be followed in #349.

I think the public header files (as are installed on the system and used while compiling and linking executables and other libraries against the base one[s]) should be namespaced - so in the end these would be included as namespace/header.h|hh, for example hal/hal.h. I already implemented it for the base libraries as part of #349.

The main ideas behind it are:

  • It seems to be a standard practise with many projects using the workspace/superbuild (etc) approach are using
  • There are actually headers named the same way in the current Machinekit-HAL's sourcebase - namely the hal.h part of the HAL and the hal.h part of the XHC WBH04B-6 module. Machinekit-HAL should force only the uniqueness of the main names on the module creators, not how they name every file - in other words, the hal.h file should be fine without risk of any clashes
  • Using namespaces will also automatically signal to anybody who is reading the code on which other parts the source depends. (Without reading the build recipes.)

cerna avatar Jul 01 '21 02:07 cerna