diff --git a/cmd/genbindings/emitcabi.go b/cmd/genbindings/emitcabi.go index 79b334eb..36fd366e 100644 --- a/cmd/genbindings/emitcabi.go +++ b/cmd/genbindings/emitcabi.go @@ -979,7 +979,7 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) { ret.WriteString( "#ifndef Q_OS_LINUX\n" + "\treturn;\n" + - "#endif\n", + "#else\n", ) } @@ -992,6 +992,12 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) { ret.WriteString("\t*outptr_" + cabiClassName(baseClass) + " = static_cast<" + baseClass + "*>(ret);\n") } + if ctor.LinuxOnly { + ret.WriteString( + "#endif\n", + ) + } + ret.WriteString( "}\n" + "\n", diff --git a/qt/gen_qsocketnotifier.cpp b/qt/gen_qsocketnotifier.cpp index 03a9e253..7d97a3f3 100644 --- a/qt/gen_qsocketnotifier.cpp +++ b/qt/gen_qsocketnotifier.cpp @@ -375,9 +375,10 @@ void QSocketDescriptor_new2(QSocketDescriptor* param1, QSocketDescriptor** outpt void QSocketDescriptor_new3(int descriptor, QSocketDescriptor** outptr_QSocketDescriptor) { #ifndef Q_OS_LINUX return; -#endif +#else QSocketDescriptor* ret = new QSocketDescriptor(static_cast(descriptor)); *outptr_QSocketDescriptor = ret; +#endif } bool QSocketDescriptor_IsValid(const QSocketDescriptor* self) { diff --git a/qt6/gen_qsocketnotifier.cpp b/qt6/gen_qsocketnotifier.cpp index cdb8260d..dd8115fe 100644 --- a/qt6/gen_qsocketnotifier.cpp +++ b/qt6/gen_qsocketnotifier.cpp @@ -364,9 +364,10 @@ void QSocketDescriptor_new2(QSocketDescriptor* param1, QSocketDescriptor** outpt void QSocketDescriptor_new3(int descriptor, QSocketDescriptor** outptr_QSocketDescriptor) { #ifndef Q_OS_LINUX return; -#endif +#else QSocketDescriptor* ret = new QSocketDescriptor(static_cast(descriptor)); *outptr_QSocketDescriptor = ret; +#endif } bool QSocketDescriptor_IsValid(const QSocketDescriptor* self) {