aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-09-27 16:25:23 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-09-30 07:37:23 +0200
commita35ed97ffea70b2e8b086ef5adf08662b59ca7c8 (patch)
treeda473606c8b53c1ef548ec5804c455acc3d6cccc /sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
parent7f2874cf7e9c955a009d06da0b4c848c6a404215 (diff)
shiboken6: Ensure that code parsing sees standard integer typedefs
Extend the system header to check to include the types headers. Task-number: PYSIDE-1660 Change-Id: I8ef753c15aafe8e613df012af55ad4d900ad43da Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
index 0b6c87ffc..1cd9937fa 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/clangbuilder.cpp
@@ -845,15 +845,16 @@ bool BuilderPrivate::visitHeader(const char *cFileName) const
{
// Resolve OpenGL typedefs although the header is considered a system header.
const char *baseName = cBaseName(cFileName);
- if (cCompareFileName(baseName, "gl.h"))
+ if (cCompareFileName(baseName, "gl.h")
+ || cCompareFileName(baseName, "stdint.h") // Windows: int32_t, uint32_t
+ || cCompareFileName(baseName, "stddef.h")) { // size_t
return true;
-#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
- if (cStringStartsWith(cFileName, "/usr/include/stdint.h"))
- return true;
-#endif
+ }
#ifdef Q_OS_LINUX
if (cStringStartsWith(cFileName, "/usr/include/stdlib.h")
- || cStringStartsWith(cFileName, "/usr/include/sys/types.h")) {
+ || cCompareFileName(baseName, "types.h")
+ || cCompareFileName(baseName, "stdint-intn.h") // int32_t
+ || cCompareFileName(baseName, "stdint-uintn.h")) { // uint32_t
return true;
}
#endif // Q_OS_LINUX