Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Adjust coding style of include path #429

Merged
merged 4 commits into from
Jan 7, 2022
Merged

Adjust coding style of include path #429

merged 4 commits into from
Jan 7, 2022

Conversation

wcwang
Copy link
Contributor

@wcwang wcwang commented Dec 29, 2021

Adjust the format of include path for all platforms according to the coding style. In the #include directive, only the header file name (or prefixed with the name of the subdirectory under the include path) is reserved.

  • Add header search paths to the project file and remove the redundant relative paths in headers, implementation and resource files
  • Update the #include directives for Windows, macOS, Linux and NetBSD platforms

Adjust the format of include path for Windows platform according to the
coding style.

* Add header search paths to the project file and remove the redundant
  relative paths
* Include headers in the following order:
  - Related header
  - System headers
  - Public platform-independent headers
  - Public platform-dependent headers
  - Private platform-independent headers
  - Private platform-dependent headers
* Unify the naming style for header files
* Move the IOCTL definitions to the Windows interface header file

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Adjust the format of include path for macOS platform.

* Add header search paths to the project file and remove the redundant
  relative paths
* Sort the order of included headers
* Unify the name of platform-dependent header files and
  implementation files to be consistent with other platforms

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
@krytarowski
Copy link
Contributor

Did you test NetBSD? param.h and types.h must go first.

@wcwang
Copy link
Contributor Author

wcwang commented Dec 29, 2021

Did you test NetBSD? param.h and types.h must go first.

Thanks for your attention. We don't have NetBSD environment to verify it yet. Do you have time to test it on NetBSD? If possible, you may base on my patch and complement the Makefile part for header search path and I will cancel my patch then. Thanks a lot.

@krytarowski
Copy link
Contributor

Please revert all reordering of kernel headers for NetBSD and add CPPFLAGS+= -I$(src)/../../include -I$(src)/../../core/include in the Makefile. Then I will build test it.

Adjust the format of include path for Linux platform.

* Add header search paths to the project file and remove the redundant
  relative paths
* Sort the order of included headers

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
@wcwang
Copy link
Contributor Author

wcwang commented Dec 29, 2021

Thanks for your reply. I have updated the patch for NetBSD. Could you help to build it? If there is any issue, please let me know. Thanks again.

@wcwang wcwang removed the CI:Build Fail CI:Build Fail label Dec 29, 2021
@HaxmCI HaxmCI added the CI:Build Fail CI:Build Fail label Dec 29, 2021
@wcwang
Copy link
Contributor Author

wcwang commented Jan 4, 2022

@krytarowski, have you ever verified the build on NetBSD? May I merge this PR then? Thanks a lot.

@wcwang wcwang requested a review from hyuan3 January 4, 2022 08:09
@wcwang
Copy link
Contributor Author

wcwang commented Jan 6, 2022

@krytarowski, sorry for bothering you. As HAXM is approaching to release, if you do not have time to verify the build, could you review the updated patch? If the NetBSD code review passes, we can merge it first. Thanks a lot.

@krytarowski
Copy link
Contributor

Testing now.

@krytarowski
Copy link
Contributor

I had to do this on top of this pull-request in order to make it buildable.

diff --git a/platforms/netbsd/Makefile b/platforms/netbsd/Makefile
index 4b601de..8853550 100644
--- a/platforms/netbsd/Makefile
+++ b/platforms/netbsd/Makefile
@@ -2,7 +2,8 @@ S?=	/usr/src/sys
 
 KMOD=	haxm
 
-CPPFLAGS+= -I$(src)/../../include -I$(src)/../../core/include
+CFLAGS+=-Wno-error=address-of-packed-member
+CPPFLAGS+= -I../../include -I../../core/include
 
 # toplevel
 SRCS+=	components.c

Adjust the format of include path for NetBSD platform.

* Add header search paths to the project file and remove the redundant
  relative paths
* Sort the order of included headers

Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
@wcwang
Copy link
Contributor Author

wcwang commented Jan 7, 2022

@krytarowski, thanks for your verification. I have updated the patch of NetBSD and will merge it later. Thanks.

@wcwang wcwang added CI:Build Pass CI:Build Pass and removed CI:Build Fail CI:Build Fail labels Jan 7, 2022
@wcwang wcwang merged commit 33a0980 into master Jan 7, 2022
@wcwang wcwang deleted the include-path branch January 7, 2022 10:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI:Build Pass CI:Build Pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants