aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp40
1 files changed, 23 insertions, 17 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
index 6f5a4d47f..5ea4af308 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
@@ -830,24 +830,30 @@ bool BuilderPrivate::visitHeader(const QString &fileName) const
|| baseName == u"stddef.h") { // size_t
return true;
}
-#ifdef Q_OS_LINUX
- if (fileName == u"/usr/include/stdlib.h"
- || baseName == u"types.h"
- || baseName == u"stdint-intn.h" // int32_t
- || baseName == u"stdint-uintn.h") { // uint32_t
- return true;
- }
-#endif // Q_OS_LINUX
-#ifdef Q_OS_MACOS
- // Parse the following system headers to get the correct typdefs for types like
- // int32_t, which are used in the macOS implementation of OpenGL framework.
- if (baseName == u"gltypes.h"
- || fileName.startsWith(u"/usr/include/_types")
- || fileName.startsWith(u"/usr/include/_types")
- || fileName.startsWith(u"/usr/include/sys/_types")) {
- return true;
+
+ switch (clang::platform()) {
+ case Platform::Unix:
+ if (fileName == u"/usr/include/stdlib.h"
+ || baseName == u"types.h"
+ || baseName == u"stdint-intn.h" // int32_t
+ || baseName == u"stdint-uintn.h") { // uint32_t
+ return true;
+ }
+ break;
+ case Platform::macOS:
+ // Parse the following system headers to get the correct typdefs for types like
+ // int32_t, which are used in the macOS implementation of OpenGL framework.
+ if (baseName == u"gltypes.h"
+ || fileName.startsWith(u"/usr/include/_types")
+ || fileName.startsWith(u"/usr/include/_types")
+ || fileName.startsWith(u"/usr/include/sys/_types")) {
+ return true;
+ }
+ break;
+ default:
+ break;
}
-#endif // Q_OS_MACOS
+
for (const auto &systemInclude : m_systemIncludes) {
if (systemInclude == baseName)
return true;