Posts

Post not yet marked as solved
3 Replies
To what end? My primary goal to performing exception handling is that when an exception occurs, I want to be able to perform proper finalization(like closing open file handles and ports etc.) for my application before the exception causes my application to terminate. Additionally, I want to show an alert box to the user informing him about the steps to take in case the exception can be recovered like providing a restart button If that could help. I want to be able to provide a better user experience.
Post not yet marked as solved
6 Replies
@eskimo Can you please revert on this?
Post not yet marked as solved
6 Replies
I have tried this in an independent project and it works. However, I have figured out the reason why I m getting this error and wanted your help on how to resolve this. My project is using the new interop mechanism using the modulemap file. For this, I m setting the interoperability to c++ in the build setting. After changing the interoperability to C++, I m getting this error for the SessionGetinfo Api. Can you please check this? public static func GetSessionInfo () -> Void { var sessionID = SecuritySessionId() var sessionAttrs = SessionAttributeBits() let status = SessionGetInfo(callerSecuritySession, &sessionID, &sessionAttrs) //error:Cannot convert value of type 'UnsafeMutablePointer<SessionAttributeBits>' to expected argument type 'UnsafeMutablePointer<UInt32>' if status != errSessionSuccess { print("Could not get session info. Error \(status)") } } You can try this in your project.
Post not yet marked as solved
5 Replies
I have also tried setting the cpp macros in Apple clang but it's also not identified in swift.
Post not yet marked as solved
5 Replies
I have reproduced this problem without cmake. Can you help now? I have an Xcode project containing a cpp target and a swift target. I am making direct swift to cpp call by exposing cpp to swift using the modulemap file. For the cpp target, I have defined some macros which I m using in the cpp header contained in the modulemap file. I m able to successfully build the cpp target. However, when I build the swift target I get an error message stating that the macros are not declared. When swift tries to import the cpp header via the clang module, it is not able to identify the cpp macros. I m setting the macros in the Compiler flags for the cpp file. You can see this in the image below. One of the macro(WINDOW_KERNEL) is defined with some value. error:Use of undeclared identifier 'WIN32' error:Use of undeclared identifier 'WINDOW_KERNEL'
Post not yet marked as solved
6 Replies
I m also using Xcode 15.2, but I m still getting this error. I am having a macOS GUI project.
Post not yet marked as solved
5 Replies
I m setting these preprocessor compillation flags in the cmake file using add_compile_definitions command. These flags are appearing in the Swift Compiler custom flags(under Active Compilation Conditions), But the swift is producing an error as above.
Post not yet marked as solved
3 Replies
I have tried the below solution, but it seems to be unsafe as it is giving warning: // swift method that return UnsafeMutablePointer which gets casted to char * in cpp let x = mySwiftString.cString(using: .utf8) return UnsafeMutablePointer<CChar>(mutating: x) // warning at return : Initialization of 'UnsafeMutablePointer<CChar>' (aka 'UnsafeMutablePointer<Int8>') results in a dangling pointer
Post marked as solved
3 Replies
I tried running sysctl kern.hv_vmm_present on the terminal in Amazon EC2 VM, however it does not give the right output. Even on a cloud VM it returns kern.hv_vmm_present: 0. Any reasons why or how can I identify the process running on VM?