linuxonly: fix ifdef quirks for building on windows

This commit is contained in:
mappu 2024-11-19 20:45:45 +13:00
parent 3902c9d36b
commit bbc75b8ef1
3 changed files with 11 additions and 3 deletions

View File

@ -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",

View File

@ -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<QSocketDescriptor::DescriptorType>(descriptor));
*outptr_QSocketDescriptor = ret;
#endif
}
bool QSocketDescriptor_IsValid(const QSocketDescriptor* self) {

View File

@ -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<QSocketDescriptor::DescriptorType>(descriptor));
*outptr_QSocketDescriptor = ret;
#endif
}
bool QSocketDescriptor_IsValid(const QSocketDescriptor* self) {